mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
on2avc: limit number of bits to 30 in get_egolomb
More don't fit into the integer output.
Also use get_bits_long, since get_bits only supports reading up to 25
bits, while get_bits_long supports the full integer range.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 4d5c3b02e9
)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
c1b7e9fe52
commit
564e63a033
@ -211,9 +211,16 @@ static inline int get_egolomb(GetBitContext *gb)
|
||||
{
|
||||
int v = 4;
|
||||
|
||||
while (get_bits1(gb)) v++;
|
||||
while (get_bits1(gb)) {
|
||||
v++;
|
||||
if (v > 30) {
|
||||
av_log(NULL, AV_LOG_WARNING, "Too large golomb code in get_egolomb.\n");
|
||||
v = 30;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (1 << v) + get_bits(gb, v);
|
||||
return (1 << v) + get_bits_long(gb, v);
|
||||
}
|
||||
|
||||
static int on2avc_decode_pairs(On2AVCContext *c, GetBitContext *gb, float *dst,
|
||||
|
Loading…
Reference in New Issue
Block a user