[FFmpeg-cvslog] wavpack: check that there aren't too many blocks per packet
Anton Khirnov
git at videolan.org
Wed May 29 05:18:36 CEST 2013
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon May 27 19:11:09 2013 +0200| [eae1b8451a4d606dd457736ce7240ee12535fb36] | committer: Anton Khirnov
wavpack: check that there aren't too many blocks per packet
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eae1b8451a4d606dd457736ce7240ee12535fb36
---
libavcodec/wavpack.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 9c766ca..7a14519 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -1120,6 +1120,11 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
}
}
+ if (wc->ch_offset + s->stereo >= avctx->channels) {
+ av_log(avctx, AV_LOG_WARNING, "Too many channels coded in a packet.\n");
+ return (avctx->err_recognition & AV_EF_EXPLODE) ? AVERROR_INVALIDDATA : 0;
+ }
+
samples_l = frame->extended_data[wc->ch_offset];
if (s->stereo)
samples_r = frame->extended_data[wc->ch_offset + 1];
More information about the ffmpeg-cvslog
mailing list