mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
avcodec/rangecoder: Check e
Fixes hang.nut Found-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b2955b6c5aed11026ec5c7164462899a10cdb937) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
d4b1fe72c2
commit
3cd1be9702
@ -47,8 +47,11 @@ static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state,
|
|||||||
else {
|
else {
|
||||||
int i, e, a;
|
int i, e, a;
|
||||||
e = 0;
|
e = 0;
|
||||||
while (get_rac(c, state + 1 + FFMIN(e, 9))) // 1..10
|
while (get_rac(c, state + 1 + FFMIN(e, 9))) { // 1..10
|
||||||
e++;
|
e++;
|
||||||
|
if (e > 31)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
a = 1;
|
a = 1;
|
||||||
for (i = e - 1; i >= 0; i--)
|
for (i = e - 1; i >= 0; i--)
|
||||||
|
@ -565,6 +565,8 @@ static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
|
|||||||
e= 0;
|
e= 0;
|
||||||
while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
|
while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
|
||||||
e++;
|
e++;
|
||||||
|
if (e > 31)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
a= 1;
|
a= 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user