[FFmpeg-cvslog] cook: check js_subband_start for validity
Michael Niedermayer
git at videolan.org
Thu Feb 21 02:30:18 CET 2013
ffmpeg | branch: release/0.8 | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 20 00:19:39 2013 +0100| [dfeef3a209ecb3dcf01a1ad14e7fc4586e630e93] | committer: Michael Niedermayer
cook: check js_subband_start for validity
Fixes out of array read
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit c69315a5deb0f8095e6b4746b69171d6f3059b2f)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dfeef3a209ecb3dcf01a1ad14e7fc4586e630e93
---
libavcodec/cook.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index a5da74e..14614c9 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -1086,6 +1086,11 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
if (extradata_size >= 8){
bytestream_get_be32(&edata_ptr); //Unknown unused
q->subpacket[s].js_subband_start = bytestream_get_be16(&edata_ptr);
+ if (q->subpacket[s].js_subband_start >= 51) {
+ av_log(avctx, AV_LOG_ERROR, "js_subband_start %d is too large\n", q->subpacket[s].js_subband_start);
+ return AVERROR_INVALIDDATA;
+ }
+
q->subpacket[s].js_vlc_bits = bytestream_get_be16(&edata_ptr);
extradata_size -= 8;
}
More information about the ffmpeg-cvslog
mailing list