[FFmpeg-cvslog] avidec: fix odd extradata size case.

Michael Niedermayer git at videolan.org
Thu May 31 01:02:13 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu May 31 00:46:47 2012 +0200| [57778f61d0ae2059ed95567f8e5b568fa817d33e] | committer: Michael Niedermayer

avidec: fix odd extradata size case.

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

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

 libavformat/avidec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 1638e28..24aacd0 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -602,7 +602,8 @@ static int avi_read_header(AVFormatContext *s)
                     }
 
                     if(size > 10*4 && size<(1<<30) && size < avi->fsize){
-                        st->codec->extradata_size= size - 10*4;
+                        if(esize == size-1 && (esize&1)) st->codec->extradata_size= esize - 10*4;
+                        else                             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;



More information about the ffmpeg-cvslog mailing list