aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-11-15 20:49:17 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-19 03:51:39 +0100
commitf869846537472ec021bde3bef71c64e28f2085f7 (patch)
treeef755817ebf448936c10cbd8b0fc912a110f3f7b
parent8930b2d532c9ba1c7b7b0cdb7828acc0e13968c5 (diff)
downloadffmpeg-f869846537472ec021bde3bef71c64e28f2085f7.tar.gz
avcodec/jpeg2000: Check comp coords to be within the supported size
Fixes assertion failure Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi This fix is choosen to be simple to backport, better solution for master is planed Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a1a8cbcb35ef2759a66b4f0875785e4b3f277057) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/jpeg2000.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index 2fe20387c1..2023978b0c 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -217,6 +217,11 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
return AVERROR_INVALIDDATA;
csize = (comp->coord[0][1] - comp->coord[0][0]) *
(comp->coord[1][1] - comp->coord[1][0]);
+ if (comp->coord[0][1] > 32768 ||
+ comp->coord[1][1] > 32768) {
+ av_log(avctx, AV_LOG_ERROR, "component size too large\n");
+ return AVERROR_PATCHWELCOME;
+ }
if (codsty->transform == FF_DWT97) {
comp->i_data = NULL;