j2kdec: Check curtileno for validity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3eedf9f716)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -421,6 +421,10 @@ static uint8_t get_sot(J2kDecoderContext *s)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
s->curtileno = bytestream_get_be16(&s->buf); ///< Isot
|
||||
if((unsigned)s->curtileno >= s->numXtiles * s->numYtiles){
|
||||
s->curtileno=0;
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
s->buf += 4; ///< Psot (ignored)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user