diff options
author | Jun Zhao <mypopydev@gmail.com> | 2018-10-28 10:44:29 +0800 |
---|---|---|
committer | Jun Zhao <jun.zhao@intel.com> | 2018-10-30 13:17:09 +0800 |
commit | f3bcb9c16a427934a681558a24202bd118e0aa06 (patch) | |
tree | 52398275cd24bff516e964fd76f66f8e6dabbade | |
parent | 903f2beafc7c5379ff65a7ca9b9e7b7ee49c75bf (diff) | |
download | ffmpeg-f3bcb9c16a427934a681558a24202bd118e0aa06.tar.gz |
lavu/frame: Add error report if av_image_fill_pointers fail.
Add error handle if av_image_fill_pointers fail.
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavutil/frame.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c index 92626dccf2..9b3fb13e68 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -243,11 +243,13 @@ static int get_video_buffer(AVFrame *frame, int align) return ret; frame->buf[0] = av_buffer_alloc(ret + 4*plane_padding); - if (!frame->buf[0]) + if (!frame->buf[0]) { + ret = AVERROR(ENOMEM); goto fail; + } - if (av_image_fill_pointers(frame->data, frame->format, padded_height, - frame->buf[0]->data, frame->linesize) < 0) + if ((ret = av_image_fill_pointers(frame->data, frame->format, padded_height, + frame->buf[0]->data, frame->linesize)) < 0) goto fail; for (i = 1; i < 4; i++) { @@ -260,7 +262,7 @@ static int get_video_buffer(AVFrame *frame, int align) return 0; fail: av_frame_unref(frame); - return AVERROR(ENOMEM); + return ret; } static int get_audio_buffer(AVFrame *frame, int align) |