Browse Source

lzw: check for overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.11
Michael Niedermayer 13 years ago
parent
commit
44c4170c52
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/lzw.c

+ 4
- 0
libavcodec/lzw.c View File

@@ -190,6 +190,10 @@ int ff_lzw_decode(LZWState *p, uint8_t *buf, int len){
if ((--l) == 0)
goto the_end;
}
if (s->ebuf < s->pbuf) {
av_log(0, AV_LOG_ERROR, "lzw overread\n");
goto the_end;
}
c = lzw_get_code(s);
if (c == s->end_code) {
break;


Loading…
Cancel
Save