summaryrefslogtreecommitdiffstats
path: root/libavcodec/adpcm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-24 19:17:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-24 19:29:03 +0100
commit807fa714f05c584ac027c36841315cea98f329d3 (patch)
tree06fcca4e24edc12d9c430af7813a27a06ce4d3b7 /libavcodec/adpcm.c
parent34b6f1efa20694eab6268197e788a3c1a5cb2a3b (diff)
downloadffmpeg-streaming-807fa714f05c584ac027c36841315cea98f329d3.zip
ffmpeg-streaming-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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index d8bbdbb..3249522 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;
OpenPOWER on IntegriCloud