mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-12-04 01:01:30 +00:00
avcodec/jpeg2000dec: Check PPx / PPy values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
08724da976
commit
2d8bf3d126
@ -461,6 +461,13 @@ static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c)
|
||||
byte = bytestream2_get_byte(&s->g);
|
||||
c->log2_prec_widths[i] = byte & 0x0F; // precinct PPx
|
||||
c->log2_prec_heights[i] = (byte >> 4) & 0x0F; // precinct PPy
|
||||
if (i)
|
||||
if (c->log2_prec_widths[i] == 0 || c->log2_prec_heights[i] == 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "PPx %d PPy %d invalid\n",
|
||||
c->log2_prec_widths[i], c->log2_prec_heights[i]);
|
||||
c->log2_prec_widths[i] = c->log2_prec_heights[i] = 1;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
memset(c->log2_prec_widths , 15, sizeof(c->log2_prec_widths ));
|
||||
|
Loading…
Reference in New Issue
Block a user