Commit 12ba1b2b authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000dec: Check that coords match before applying ICT

This avoid potential out of array accesses
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 028c59c1
......@@ -1148,11 +1148,16 @@ static inline void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
int i, csize = 1;
void *src[3];
for (i = 1; i < 3; i++)
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;
}
if (memcmp(tile->comp[0].coord, tile->comp[i].coord, sizeof(tile->comp[0].coord))) {
av_log(s->avctx, AV_LOG_ERROR, "Coords mismatch, MCT not supported\n");
return;
}
}
for (i = 0; i < 3; i++)
if (tile->codsty[0].transform == FF_DWT97)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment