[FFmpeg-cvslog] avcodec/avpacket: Fix memory allocation failure check

Michael Niedermayer git at videolan.org
Sun Aug 11 11:02:12 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Aug 11 10:56:07 2013 +0200| [b905a7137a51a9a4f66d75172897d1f38c0b292a] | committer: Michael Niedermayer

avcodec/avpacket: Fix memory allocation failure check

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b905a7137a51a9a4f66d75172897d1f38c0b292a
---

 libavcodec/avpacket.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 87d1507..8b65e45 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);



More information about the ffmpeg-cvslog mailing list