apedec: check bits <= 32
Fixes FPE Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -421,9 +421,12 @@ static inline int ape_decode_value(APEContext *ctx, APERice *rice)
|
|||||||
|
|
||||||
if (tmpk <= 16)
|
if (tmpk <= 16)
|
||||||
x = range_decode_bits(ctx, tmpk);
|
x = range_decode_bits(ctx, tmpk);
|
||||||
else {
|
else if (tmpk <= 32) {
|
||||||
x = range_decode_bits(ctx, 16);
|
x = range_decode_bits(ctx, 16);
|
||||||
x |= (range_decode_bits(ctx, tmpk - 16) << 16);
|
x |= (range_decode_bits(ctx, tmpk - 16) << 16);
|
||||||
|
} else {
|
||||||
|
av_log(ctx->avctx, AV_LOG_ERROR, "too many bits\n");
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
x += overflow << tmpk;
|
x += overflow << tmpk;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user