1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 17:12:36 +00:00

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.
This commit is contained in:
Uoti Urpala 2011-02-02 09:13:14 +02:00
parent dbb47bb2ec
commit 0cb63ea722

View File

@ -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);