summaryrefslogtreecommitdiff
path: root/libavcodec/wavpack.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2006-10-14 05:01:05 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2006-10-14 05:01:05 +0000
commit4ec0beaa593860796feead14132506226a1edf0e (patch)
tree31b8fd3d3c2dbcf87252051421cf79f82af5cb2d /libavcodec/wavpack.c
parent03bb9ae58c8fe4b7cb0bd478e48a436305ef2ebc (diff)
Move block size check to decoder
Originally committed as revision 6688 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r--libavcodec/wavpack.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 75456afe2e..53ba34b69d 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -388,6 +388,11 @@ static int wavpack_decode_frame(AVCodecContext *avctx,
memset(s->decorr, 0, MAX_TERMS * sizeof(Decorr));
s->samples = LE_32(buf); buf += 4;
+ /* should not happen but who knows */
+ if(s->samples * 2 * avctx->channels > AVCODEC_MAX_AUDIO_FRAME_SIZE){
+ av_log(avctx, AV_LOG_ERROR, "Packet size is too big to be handled in lavc!\n");
+ return -1;
+ }
s->joint = LE_32(buf) & WV_JOINT; buf += 4;
s->CRC = LE_32(buf); buf += 4;
// parse metadata blocks