adpcmdec: Fix OOM/infloop

Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-24 19:17:23 +01:00
parent 34b6f1efa2
commit 807fa714f0
1 changed files with 5 additions and 0 deletions

View File

@ -1355,6 +1355,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
return -1;
}
if (avpkt->size && bytestream2_tell(&gb) == 0) {
av_log(avctx, AV_LOG_ERROR, "Nothing consumed\n");
return AVERROR_INVALIDDATA;
}
*got_frame_ptr = 1;
*(AVFrame *)data = c->frame;