Make avpicture_fill() return a meaningful error code.
Originally committed as revision 25687 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -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,
|
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
|
||||||
enum PixelFormat pix_fmt, int width, int height)
|
enum PixelFormat pix_fmt, int width, int height)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
if(av_image_check_size(width, height, 0, NULL))
|
if ((ret = av_image_check_size(width, height, 0, NULL)) < 0)
|
||||||
return -1;
|
return ret;
|
||||||
|
|
||||||
if (av_image_fill_linesizes(picture->linesize, pix_fmt, width))
|
if ((ret = av_image_fill_linesizes(picture->linesize, pix_fmt, width)) < 0)
|
||||||
return -1;
|
return ret;
|
||||||
|
|
||||||
return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);
|
return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user