diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-11-07 13:30:36 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-11-07 13:30:36 +0000 |
commit | f35a41ff5d99fee31b61e6dea419700bef91bbe3 (patch) | |
tree | 1c68020db0053ee0688786bf075c0c9701e74405 /libavcodec/imgconvert.c | |
parent | 24409b50539edd3228e910bb97cda9fdccf7c8ac (diff) | |
download | ffmpeg-f35a41ff5d99fee31b61e6dea419700bef91bbe3.tar.gz |
Make avpicture_fill() return a meaningful error code.
Originally committed as revision 25687 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/imgconvert.c')
-rw-r--r-- | libavcodec/imgconvert.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 0ee2f49d8b..8459d68207 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -511,12 +511,13 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, int avpicture_fill(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, int width, int height) { + int ret; - if(av_image_check_size(width, height, 0, NULL)) - return -1; + if ((ret = av_image_check_size(width, height, 0, NULL)) < 0) + return ret; - if (av_image_fill_linesizes(picture->linesize, pix_fmt, width)) - return -1; + if ((ret = av_image_fill_linesizes(picture->linesize, pix_fmt, width)) < 0) + return ret; return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize); } |