summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-09 00:37:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-09 01:02:05 +0200
commit12ba1b2b4d5592c0e27b0fcc83db929e8d6a8eee (patch)
tree1d691c628679f4695505fa228586c94c248c12be /libavcodec
parent028c59c17b14751e049a05abbdac52f885ad96a2 (diff)
avcodec/jpeg2000dec: Check that coords match before applying ICT
This avoid potential out of array accesses Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/jpeg2000dec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 6587e7d90b..ee70bded17 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -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)