diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-07-23 14:19:09 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-07-23 23:03:37 +0200 |
commit | 6fd221e5f8b0dcd33c249e553ea0be87778f2479 (patch) | |
tree | 185ede9202ce787d51c120d7496febecb828e048 | |
parent | bd7b4da0f4627bb6c4a7c2575da83fe6b261a21c (diff) | |
download | ffmpeg-6fd221e5f8b0dcd33c249e553ea0be87778f2479.tar.gz |
8bps: Make the bound-checks consistent
-rw-r--r-- | libavcodec/8bps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index dbe1f22915..ad1266f6b5 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -105,7 +105,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, if ((count = *dp++) <= 127) { count++; dlen -= count + 1; - if (pixptr + count * px_inc > pixptr_end) + if (pixptr_end - pixptr < count * px_inc) break; if (ep - dp < count) return AVERROR_INVALIDDATA; @@ -115,7 +115,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, } } else { count = 257 - count; - if (pixptr + count * px_inc > pixptr_end) + if (pixptr_end - pixptr < count * px_inc) break; while (count--) { *pixptr = *dp; |