Browse Source

avcodec/rangecoder: Check e

Fixes hang.nut

Found-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.0
Michael Niedermayer 9 years ago
parent
commit
b2955b6c5a
2 changed files with 6 additions and 1 deletions
  1. +4
    -1
      libavcodec/ffv1dec.c
  2. +2
    -0
      libavcodec/snow.h

+ 4
- 1
libavcodec/ffv1dec.c View File

@@ -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--)


+ 2
- 0
libavcodec/snow.h View File

@@ -564,6 +564,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…
Cancel
Save