diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-19 05:33:40 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-13 21:23:24 +0400 |
commit | ac3b01a9c0607961f4540fe62040833870f5deb1 (patch) | |
tree | fe890fc1950fc4373c5d07b2f9d0e68690b3b676 /libavcodec/jpeg2000dec.c | |
parent | 522f78f8eabfc1277b11fad13d40870caf5718ab (diff) |
avcodec/jpeg2000dec: check transform equality in MCT
Fixes null pointer dereference
Fixes Ticket2843
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000dec.c')
-rw-r--r-- | libavcodec/jpeg2000dec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index aae369787f..cbba2d02d8 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1140,6 +1140,12 @@ static void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile) int32_t *src[3], i0, i1, i2; float *srcf[3], i0f, i1f, i2f; + for (i = 1; i < 3; i++) + if (tile->codsty[0].transform != tile->codsty[i].transform) { + av_log(s->avctx, AV_LOG_ERROR, "Transforms mismatch, MCT not supported\n"); + return; + } + for (i = 0; i < 3; i++) if (tile->codsty[0].transform == FF_DWT97) srcf[i] = tile->comp[i].f_data; |