Make avpicture_alloc() return meaningful values.

Originally committed as revision 25922 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Stefano Sabatini 2010-12-08 10:24:09 +00:00
parent 0141163d6a
commit 6d34323ee6
1 changed files with 4 additions and 2 deletions

View File

@ -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;