diff options
Diffstat (limited to 'libavutil/lzo.c')
-rw-r--r-- | libavutil/lzo.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavutil/lzo.c b/libavutil/lzo.c index 8cb26370ec..e284fa8f26 100644 --- a/libavutil/lzo.c +++ b/libavutil/lzo.c @@ -62,7 +62,13 @@ static inline int get_byte(LZOContext *c) { static inline int get_len(LZOContext *c, int x, int mask) { int cnt = x & mask; if (!cnt) { - while (!(x = get_byte(c))) cnt += 255; + while (!(x = get_byte(c))) { + if (cnt >= INT_MAX - 1000) { + c->error |= AV_LZO_ERROR; + break; + } + cnt += 255; + } cnt += mask + x; } return cnt; |