Commit 1973414f authored by kostya's avatar kostya

Do not try to decode more data than output buffer may hold

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10560 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 8ee84d5a
...@@ -328,6 +328,11 @@ static int adx_decode_frame(AVCodecContext *avctx, ...@@ -328,6 +328,11 @@ static int adx_decode_frame(AVCodecContext *avctx,
rest -= hdrsize; rest -= hdrsize;
} }
/* 18 bytes of data are expanded into 32*2 bytes of audio,
so guard against buffer overflows */
if(rest/18 > *data_size/64)
rest = (*data_size/64) * 18;
if (c->in_temp) { if (c->in_temp) {
int copysize = 18*avctx->channels - c->in_temp; int copysize = 18*avctx->channels - c->in_temp;
memcpy(c->dec_temp+c->in_temp,buf,copysize); memcpy(c->dec_temp+c->in_temp,buf,copysize);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment