[FFmpeg-cvslog] r19119 - in trunk/libavformat: oggparsespeex.c oggparsetheora.c

conrad subversion
Sat Jun 6 01:39:11 CEST 2009


Author: conrad
Date: Sat Jun  6 01:39:11 2009
New Revision: 19119

Log:
Ensure that the extradata buffer is padded appripriately in the ogg demuxer.
Spotted by valgrind.

Modified:
   trunk/libavformat/oggparsespeex.c
   trunk/libavformat/oggparsetheora.c

Modified: trunk/libavformat/oggparsespeex.c
==============================================================================
--- trunk/libavformat/oggparsespeex.c	Fri Jun  5 19:11:46 2009	(r19118)
+++ trunk/libavformat/oggparsespeex.c	Sat Jun  6 01:39:11 2009	(r19119)
@@ -47,7 +47,8 @@ static int speex_header(AVFormatContext 
         st->codec->channels = AV_RL32(p + 48);
         st->codec->frame_size = AV_RL32(p + 56);
         st->codec->extradata_size = os->psize;
-        st->codec->extradata = av_malloc(st->codec->extradata_size);
+        st->codec->extradata = av_malloc(st->codec->extradata_size
+                                         + FF_INPUT_BUFFER_PADDING_SIZE);
         memcpy(st->codec->extradata, p, st->codec->extradata_size);
 
         st->time_base.num = 1;

Modified: trunk/libavformat/oggparsetheora.c
==============================================================================
--- trunk/libavformat/oggparsetheora.c	Fri Jun  5 19:11:46 2009	(r19118)
+++ trunk/libavformat/oggparsetheora.c	Sat Jun  6 01:39:11 2009	(r19119)
@@ -106,7 +106,8 @@ theora_header (AVFormatContext * s, int 
         vorbis_comment (s, os->buf + os->pstart + 7, os->psize - 8);
     }
 
-    st->codec->extradata = av_realloc (st->codec->extradata, cds);
+    st->codec->extradata = av_realloc (st->codec->extradata,
+                                       cds + FF_INPUT_BUFFER_PADDING_SIZE);
     cdp = st->codec->extradata + st->codec->extradata_size;
     *cdp++ = os->psize >> 8;
     *cdp++ = os->psize & 0xff;



More information about the ffmpeg-cvslog mailing list