You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
jpeg2000: Check block length
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
@@ -715,6 +715,13 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
|
|||||||
}
|
}
|
||||||
cblk->length += cblk->lengthinc;
|
cblk->length += cblk->lengthinc;
|
||||||
cblk->lengthinc = 0;
|
cblk->lengthinc = 0;
|
||||||
|
|
||||||
|
if (cblk->length > sizeof(cblk->data)) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
|
"Block length %d > data size %zd\n",
|
||||||
|
cblk->length, sizeof(cblk->data));
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user