avcodec/avpacket: Fix memory allocation failure check

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-08-11 10:56:07 +02:00
parent 67a580f423
commit b905a7137a

View File

@ -80,7 +80,7 @@ static int packet_alloc(AVBufferRef **buf, int size)
return AVERROR(EINVAL);
av_buffer_realloc(buf, size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!buf)
if (!*buf)
return AVERROR(ENOMEM);
memset((*buf)->data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);