avcodec_encode_video can return -1 if things went wrong. It should be checked before
From: Erik Hovland <erik@hovland.org>
any action is made with the returned value.
---
libs/libmythtv/NuppelVideoRecorder.cpp | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/libs/libmythtv/NuppelVideoRecorder.cpp b/libs/libmythtv/NuppelVideoRecorder.cpp
index d24e38a..b599847 100644
a
|
b
|
void NuppelVideoRecorder::WriteVideo(VideoFrame *frame, bool skipsync, |
3081 | 3081 | QMutexLocker locker(&avcodeclock); |
3082 | 3082 | tmp = avcodec_encode_video(mpa_vidctx, (unsigned char *)strm, |
3083 | 3083 | len, &mpa_picture); |
| 3084 | if (tmp == -1) |
| 3085 | { |
| 3086 | VERBOSE(VB_IMPORTANT, |
| 3087 | LOC_ERR + "NuppelVideoRecorder::WriteVideo : " |
| 3088 | "avcodec_encode_video() failed"); |
| 3089 | return; |
| 3090 | } |
3084 | 3091 | } |
3085 | 3092 | } |
3086 | 3093 | else |