[FFmpeg-cvslog] r19333 - trunk/libavformat/avidec.c

reimar subversion
Fri Jul 3 13:27:52 CEST 2009


Author: reimar
Date: Fri Jul  3 13:27:52 2009
New Revision: 19333

Log:
Check for failed extradata malloc, fixes a crash in out-of-memory conditions
or with extremely large extradata.

Modified:
   trunk/libavformat/avidec.c

Modified: trunk/libavformat/avidec.c
==============================================================================
--- trunk/libavformat/avidec.c	Fri Jul  3 13:26:14 2009	(r19332)
+++ trunk/libavformat/avidec.c	Fri Jul  3 13:27:52 2009	(r19333)
@@ -483,6 +483,10 @@ static int avi_read_header(AVFormatConte
                     if(size > 10*4 && size<(1<<30)){
                         st->codec->extradata_size= size - 10*4;
                         st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+                        if (!st->codec->extradata) {
+                            st->codec->extradata_size= 0;
+                            return AVERROR(ENOMEM);
+                        }
                         get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
                     }
 



More information about the ffmpeg-cvslog mailing list