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>
(cherry picked from commit 9e66b39aa8
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:

committed by
Michael Niedermayer

parent
e67181a351
commit
448d6488b1
@@ -799,7 +799,10 @@ static void decode_lowdelay(DiracContext *s)
|
|||||||
slice_num++;
|
slice_num++;
|
||||||
|
|
||||||
buf += bytes;
|
buf += bytes;
|
||||||
bufsize -= bytes*8;
|
if (bufsize/8 >= bytes)
|
||||||
|
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,
|
||||||
|
Reference in New Issue
Block a user