Commit 6d34323e authored by Stefano Sabatini's avatar Stefano Sabatini

Make avpicture_alloc() return meaningful values.

Originally committed as revision 25922 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 0141163d
......@@ -813,9 +813,11 @@ void ff_shrink88(uint8_t *dst, int dst_wrap,
int avpicture_alloc(AVPicture *picture,
enum PixelFormat pix_fmt, int width, int height)
{
if (av_image_alloc(picture->data, picture->linesize, width, height, pix_fmt, 0) < 0) {
int ret;
if ((ret = av_image_alloc(picture->data, picture->linesize, width, height, pix_fmt, 0)) < 0) {
memset(picture, 0, sizeof(AVPicture));
return -1;
return ret;
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment