diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-15 13:26:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-15 13:26:19 +0200 |
commit | 0846719dd11ab3f7a7caee13e7af71f71d913389 (patch) | |
tree | 531b38ab7fa2f2c21af0939ca7ae709d0cc34afc /libavcodec/indeo4.c | |
parent | 5a59d2c40bf805d14c7e43115d946c5afb5535ca (diff) | |
download | ffmpeg-0846719dd11ab3f7a7caee13e7af71f71d913389.tar.gz |
indeo4: check transform size.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/indeo4.c')
-rw-r--r-- | libavcodec/indeo4.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 4d315b5b8a..eacf70d52f 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -383,6 +383,10 @@ static int decode_band_hdr(IVI4DecContext *ctx, IVIBandDesc *band, return AVERROR_PATCHWELCOME; } + if (transform_id < 10 && band->blk_size < 8) { + av_log(avctx, AV_LOG_ERROR, "wrong transform size!\n"); + return AVERROR_INVALIDDATA; + } #if IVI4_STREAM_ANALYSER if ((transform_id >= 0 && transform_id <= 2) || transform_id == 10) ctx->uses_haar = 1; @@ -391,6 +395,7 @@ static int decode_band_hdr(IVI4DecContext *ctx, IVIBandDesc *band, band->inv_transform = transforms[transform_id].inv_trans; band->dc_transform = transforms[transform_id].dc_trans; band->is_2d_trans = transforms[transform_id].is_2d_trans; + band->transform_size= (transform_id < 10) ? 8 : 4; scan_indx = get_bits(&ctx->gb, 4); if ((scan_indx>4 && scan_indx<10) != (band->blk_size==4)) { |