aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-04-05 22:58:29 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit74f7e11a9811c6c73700b0185f52ef0dc07a6ab3 (patch)
treec79c8393085d7381d77e4f108c6f3684eb77cbb5
parent60d36825bcf0d20e5ab19f9d5b57f923f256d8bb (diff)
downloadffmpeg-74f7e11a9811c6c73700b0185f52ef0dc07a6ab3.tar.gz
avcodec/g2meet: Check tile_width in epic_jb_decode_tile()
Fixes: out of array access Fixes: 21469/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5199357982015488 Alternatively the arrays can be made bigger or the index can be clipped. In case a real file with such huge tiles exist we ask the user to upload it. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5501bb28ddfa6441dcbf8ea0a964a13aa33f66fe) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/g2meet.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index 6ad771abd7..61f3c36a14 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -916,6 +916,11 @@ static int epic_jb_decode_tile(G2MContext *c, int tile_x, int tile_y,
awidth = FFALIGN(tile_width, 16);
aheight = FFALIGN(tile_height, 16);
+ if (tile_width > (1 << FF_ARRAY_ELEMS(c->ec.prev_row_rung))) {
+ avpriv_request_sample(avctx, "large tile width");
+ return AVERROR_INVALIDDATA;
+ }
+
if (els_dsize) {
int ret, i, j, k;
uint8_t tr_r, tr_g, tr_b, *buf;