avcodec/jpeg2000dec: Check that coords match before applying ICT
This avoid potential out of array accesses Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
028c59c17b
commit
12ba1b2b4d
@ -1148,11 +1148,16 @@ static inline void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
|
|||||||
int i, csize = 1;
|
int i, csize = 1;
|
||||||
void *src[3];
|
void *src[3];
|
||||||
|
|
||||||
for (i = 1; i < 3; i++)
|
for (i = 1; i < 3; i++) {
|
||||||
if (tile->codsty[0].transform != tile->codsty[i].transform) {
|
if (tile->codsty[0].transform != tile->codsty[i].transform) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Transforms mismatch, MCT not supported\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Transforms mismatch, MCT not supported\n");
|
||||||
return;
|
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++)
|
for (i = 0; i < 3; i++)
|
||||||
if (tile->codsty[0].transform == FF_DWT97)
|
if (tile->codsty[0].transform == FF_DWT97)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user