j2kdec: Fix integer overflow leading to a segfault

Fixes Ticket776
Bug found by: Diana Elena Muscalu

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1f99939a63)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-12-16 04:16:01 +01:00
parent 4af03698f3
commit e7cb6e1c04
1 changed files with 1 additions and 1 deletions

View File

@ -321,7 +321,7 @@ int ff_j2k_dwt_init(DWTContext *s, uint16_t border[2][2], int decomp_levels, int
int i, j, lev = decomp_levels, maxlen,
b[2][2];
if (decomp_levels >= FF_DWT_MAX_DECLVLS)
if ((unsigned)decomp_levels >= FF_DWT_MAX_DECLVLS)
return AVERROR_INVALIDDATA;
s->ndeclevels = decomp_levels;
s->type = type;