From b905a7137a51a9a4f66d75172897d1f38c0b292a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 11 Aug 2013 10:56:07 +0200 Subject: [PATCH] avcodec/avpacket: Fix memory allocation failure check Signed-off-by: Michael Niedermayer --- libavcodec/avpacket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index 87d1507bc1..8b65e459eb 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -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);