Module: libav
Branch: master
Commit: 6fd221e5f8b0dcd33c249e553ea0be87778f2479

Author:    Luca Barbato <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Tue Jul 23 14:19:09 2013 +0200

8bps: Make the bound-checks consistent

---

 libavcodec/8bps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c
index dbe1f22..ad1266f 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;

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to