summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2011-02-02 09:13:14 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2011-02-02 09:13:14 +0200
commit0cb63ea722b4677808f3518b0baec3998874e1a9 (patch)
treea4e9bc6bbbb431ebfd554621b42ad09eb1e46964
parentdbb47bb2ec69abe56707324332233e4040f420df (diff)
downloadmpv-0cb63ea722b4677808f3518b0baec3998874e1a9.tar.bz2
mpv-0cb63ea722b4677808f3518b0baec3998874e1a9.tar.xz
ad_ffmpeg: add missing extradata padding
One of two alternative code parts passing codec extradata to libavcodec didn't add the buffer padding that libavcodec requires, resulting in invalid reads beoynd allocated memory area. Fix.
-rw-r--r--libmpcodecs/ad_ffmpeg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c
index d2f329c645..ec6a2f77ac 100644
--- a/libmpcodecs/ad_ffmpeg.c
+++ b/libmpcodecs/ad_ffmpeg.c
@@ -141,7 +141,8 @@ static int init(sh_audio_t *sh_audio)
// for QDM2
if (sh_audio->codecdata_len && sh_audio->codecdata && !lavc_context->extradata)
{
- lavc_context->extradata = av_malloc(sh_audio->codecdata_len);
+ lavc_context->extradata = av_malloc(sh_audio->codecdata_len +
+ FF_INPUT_BUFFER_PADDING_SIZE);
lavc_context->extradata_size = sh_audio->codecdata_len;
memcpy(lavc_context->extradata, (char *)sh_audio->codecdata,
lavc_context->extradata_size);