diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-24 19:17:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-24 19:29:03 +0100 |
commit | 807fa714f05c584ac027c36841315cea98f329d3 (patch) | |
tree | 06fcca4e24edc12d9c430af7813a27a06ce4d3b7 /libavcodec/adpcm.c | |
parent | 34b6f1efa20694eab6268197e788a3c1a5cb2a3b (diff) | |
download | ffmpeg-807fa714f05c584ac027c36841315cea98f329d3.tar.gz |
adpcmdec: Fix OOM/infloop
Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r-- | libavcodec/adpcm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index d8bbdbb88e..3249522293 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -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; |