Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-11-25 22:47:54 +0400
committerStefano Sabatini <stefasab@gmail.com>2012-11-25 23:34:01 +0400
commite55c3857d20ba015e4914c2e80fcab037af0799d (patch)
treee9ae0834b5031629736289800d5ee9e6487fd3a6 /libavcodec/utils.c
parent51e9f58e1c9c7e012ed7d10ade6a609221d346ef (diff)
lavc/utils: check return value of avcodec_fill_audio_frame() for < 0
Assume that the value is always negative in case of error, as stated in the docs, do not assume that the value cannot be != 0 in case of success.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 4749d739d4..6a5c735160 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -418,7 +418,7 @@ static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame)
}
if ((ret = avcodec_fill_audio_frame(frame, avctx->channels,
avctx->sample_fmt, buf->data[0],
- buf->audio_data_size, 0)))
+ buf->audio_data_size, 0)) < 0)
return ret;
if (frame->extended_data == frame->data)
@@ -1383,7 +1383,7 @@ int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
if ((ret = avcodec_fill_audio_frame(frame, avctx->channels,
avctx->sample_fmt,
(const uint8_t *)samples,
- samples_size, 1)))
+ samples_size, 1)) < 0)
return ret;
/* fabricate frame pts from sample count.