mirror of https://git.ffmpeg.org/ffmpeg.git
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 b2955b6c5a
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
b096f16095
commit
e77ad4b069
|
@ -47,8 +47,11 @@ static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state,
|
|||
else {
|
||||
int i, e, a;
|
||||
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++;
|
||||
if (e > 31)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
a = 1;
|
||||
for (i = e - 1; i >= 0; i--)
|
||||
|
|
|
@ -562,6 +562,8 @@ static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
|
|||
e= 0;
|
||||
while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
|
||||
e++;
|
||||
if (e > 31)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
a= 1;
|
||||
|
|
Loading…
Reference in New Issue