avcodec/jpeg2000dec: Handle Psot = 0
Fixes Ticket2869 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -602,6 +602,9 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
|
|||||||
/* Read TNSot but not used */
|
/* Read TNSot but not used */
|
||||||
bytestream2_get_byteu(&s->g); // TNsot
|
bytestream2_get_byteu(&s->g); // TNsot
|
||||||
|
|
||||||
|
if (!Psot)
|
||||||
|
Psot = bytestream2_get_bytes_left(&s->g) + n + 2;
|
||||||
|
|
||||||
if (Psot > bytestream2_get_bytes_left(&s->g) + n + 2) {
|
if (Psot > bytestream2_get_bytes_left(&s->g) + n + 2) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Psot %"PRIu32" too big\n", Psot);
|
av_log(s->avctx, AV_LOG_ERROR, "Psot %"PRIu32" too big\n", Psot);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
Reference in New Issue
Block a user