diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2007-01-31 10:29:58 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2007-01-31 10:29:58 +0000 |
commit | 5fe9c42cebbac9e4875f8ff30eb84ea9f8f5b407 (patch) | |
tree | 186059711b443a22a591d01bbcfb6c3d07d479b3 /libavcodec/lzo.c | |
parent | 801778bc8306e4b58d8c27022aa7903e86a2b040 (diff) | |
download | ffmpeg-5fe9c42cebbac9e4875f8ff30eb84ea9f8f5b407.tar.gz |
Add two extra needed bounds checks
Originally committed as revision 7777 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/lzo.c')
-rw-r--r-- | libavcodec/lzo.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/lzo.c b/libavcodec/lzo.c index 54a34c2bf2..5fd1f4cc06 100644 --- a/libavcodec/lzo.c +++ b/libavcodec/lzo.c @@ -182,6 +182,8 @@ int lzo1x_decode(void *out, int *outlen, void *in, int *inlen) { x = GETB(c); if (x < 16) c.error |= LZO_ERROR; } + if (c.in > c.in_end) + c.error |= LZO_INPUT_DEPLETED; while (!c.error) { int cnt, back; if (x > 15) { @@ -209,6 +211,10 @@ int lzo1x_decode(void *out, int *outlen, void *in, int *inlen) { cnt = get_len(&c, x, 15); copy(&c, cnt + 3); x = GETB(c); + if (c.in > c.in_end) { + c.error |= LZO_INPUT_DEPLETED; + continue; + } if (x >> 4) continue; cnt = 1; |