From a75ef1506a62ff21f3e282d76978b28ffc305c64 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Tue, 2 May 2017 16:09:11 +0200 Subject: [PATCH] lavc/jpeg2000dec: Fix jp2 inner atom size used for overread checks. --- libavcodec/jpeg2000dec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index e9f5f51af3..ab814cabe5 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1982,6 +1982,7 @@ static int jp2_find_codestream(Jpeg2000DecoderContext *s) atom2_end = bytestream2_tell(&s->g) + atom2_size - 8; if (atom2_size < 8 || atom2_end > atom_end || atom2_end < atom2_size) break; + atom2_size -= 8; if (atom2 == JP2_CODESTREAM) { return 1; } else if (atom2 == MKBETAG('c','o','l','r') && atom2_size >= 7) {