aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-07-23 14:19:09 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-07-23 23:03:37 +0200
commit6fd221e5f8b0dcd33c249e553ea0be87778f2479 (patch)
tree185ede9202ce787d51c120d7496febecb828e048
parentbd7b4da0f4627bb6c4a7c2575da83fe6b261a21c (diff)
downloadffmpeg-6fd221e5f8b0dcd33c249e553ea0be87778f2479.tar.gz
8bps: Make the bound-checks consistent
-rw-r--r--libavcodec/8bps.c4
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;