diracdec: avoid overflow of bytes*8 in decode_lowdelay
If bytes is large enough, bytes*8 can overflow and become negative. In that case 'bufsize -= bytes*8' causes bufsize to increase instead of decrease. This leads to a segmentation fault. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
af6739d6da
commit
9e66b39aa8
@ -801,7 +801,10 @@ static int decode_lowdelay(DiracContext *s)
|
|||||||
slice_num++;
|
slice_num++;
|
||||||
|
|
||||||
buf += bytes;
|
buf += bytes;
|
||||||
|
if (bufsize/8 >= bytes)
|
||||||
bufsize -= bytes*8;
|
bufsize -= bytes*8;
|
||||||
|
else
|
||||||
|
bufsize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
avctx->execute(avctx, decode_lowdelay_slice, slices, NULL, slice_num,
|
avctx->execute(avctx, decode_lowdelay_slice, slices, NULL, slice_num,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user