aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-20 03:15:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-23 18:17:42 +0200
commiteada99a854f8684c92dba3ce5554a9bdd8304a16 (patch)
tree16be39e1d2420ea6ba786b4abe0ae3e4b14a27c5
parent9ade5b804ea1ff98971972769c43497a597b0e77 (diff)
downloadffmpeg-eada99a854f8684c92dba3ce5554a9bdd8304a16.tar.gz
avutil/lzo: Fix integer overflow
Embargoed-till: 2014-06-27 requested by researcher, but embargo broken by libav today (git and mailing list) Fixes: LMS-2014-06-16-4 Found-by: "Don A. Bailey" <donb@securitymouse.com> See: ccda51b14c0fcae2fad73a24872dce75a7964996 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit d6af26c55c1ea30f85a7d9edbc373f53be1743ee) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/lzo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavutil/lzo.c b/libavutil/lzo.c
index 221a66b9ab..82dba94771 100644
--- a/libavutil/lzo.c
+++ b/libavutil/lzo.c
@@ -65,8 +65,13 @@ static inline int get_len(LZOContext *c, int x, int mask)
{
int cnt = x & mask;
if (!cnt) {
- while (!(x = get_byte(c)))
+ while (!(x = get_byte(c))) {
+ if (cnt >= INT_MAX - 1000) {
+ c->error |= AV_LZO_ERROR;
+ break;
+ }
cnt += 255;
+ }
cnt += mask + x;
}
return cnt;