diff libmpcodecs/ad_ffmpeg.c @ 17226:255b14c0bc36

malloc padding to avoid access beyond allocated memory Credits to Mikulas Patocka (mikulas at artax karlin mff cuni cz)
author henry
date Mon, 19 Dec 2005 19:38:28 +0000
parents a9f7eff9e437
children f0e7712385dc
line wrap: on
line diff
--- a/libmpcodecs/ad_ffmpeg.c	Mon Dec 19 18:04:37 2005 +0000
+++ b/libmpcodecs/ad_ffmpeg.c	Mon Dec 19 19:38:28 2005 +0000
@@ -73,7 +73,7 @@
 
     /* alloc extra data */
     if (sh_audio->wf && sh_audio->wf->cbSize > 0) {
-        lavc_context->extradata = av_malloc(sh_audio->wf->cbSize);
+        lavc_context->extradata = av_mallocz(sh_audio->wf->cbSize + FF_INPUT_BUFFER_PADDING_SIZE);
         lavc_context->extradata_size = sh_audio->wf->cbSize;
         memcpy(lavc_context->extradata, (char *)sh_audio->wf + sizeof(WAVEFORMATEX), 
                lavc_context->extradata_size);