summaryrefslogtreecommitdiff
path: root/libavcodec/indeo4.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-14 12:48:13 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-14 13:08:13 +0200
commitccb422a69728ac739b20ba2c67d49d265fd20fdb (patch)
tree4822e0a74d3519c725ff5430cfcb63c1b8364c48 /libavcodec/indeo4.c
parent8c0bb195220d9dc7b46701519cc1a617ddbba0b8 (diff)
parentcd78e934c246d1b2510f8fba0abfe40bb75795f6 (diff)
Merge commit 'cd78e934c246d1b2510f8fba0abfe40bb75795f6'
* commit 'cd78e934c246d1b2510f8fba0abfe40bb75795f6': indeo4: Validate scantable dimension See: 92f7f1db421ee8b3431534fa09e8050ba622c33a Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/indeo4.c')
-rw-r--r--libavcodec/indeo4.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index 7e69b9d1aa..c35ca33fc3 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -355,14 +355,20 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
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)) {
- av_log(avctx, AV_LOG_ERROR, "mismatching scan table!\n");
- return AVERROR_INVALIDDATA;
- }
if (scan_indx == 15) {
av_log(avctx, AV_LOG_ERROR, "Custom scan pattern encountered!\n");
return AVERROR_INVALIDDATA;
}
+ if (scan_indx > 4 && scan_indx < 10) {
+ if (band->blk_size != 4) {
+ av_log(avctx, AV_LOG_ERROR, "mismatching scan table!\n");
+ return AVERROR_INVALIDDATA;
+ }
+ } else if (band->blk_size != 8) {
+ av_log(avctx, AV_LOG_ERROR, "mismatching scan table!\n");
+ return AVERROR_INVALIDDATA;
+ }
+
band->scan = scan_index_to_tab[scan_indx];
band->scan_size = band->blk_size;