Commit 1e7db767 authored by reimar's avatar reimar

check that csize in ff_lzw_decode_init is < LZW_MAXBITS, <= is not enough and

might read outside the prefix array

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14214 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 15f73bb4
...@@ -131,7 +131,7 @@ int ff_lzw_decode_init(LZWState *p, int csize, const uint8_t *buf, int buf_size, ...@@ -131,7 +131,7 @@ int ff_lzw_decode_init(LZWState *p, int csize, const uint8_t *buf, int buf_size,
{ {
struct LZWState *s = (struct LZWState *)p; struct LZWState *s = (struct LZWState *)p;
if(csize < 1 || csize > LZW_MAXBITS) if(csize < 1 || csize >= LZW_MAXBITS)
return -1; return -1;
/* read buffer */ /* read buffer */
s->pbuf = buf; s->pbuf = buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment