[FFmpeg-cvslog] 8bps: Make the bound-checks consistent

Luca Barbato git at videolan.org
Wed Jul 24 12:15:54 CEST 2013


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Tue Jul 23 14:19:09 2013 +0200| [6fd221e5f8b0dcd33c249e553ea0be87778f2479] | committer: Luca Barbato

8bps: Make the bound-checks consistent

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6fd221e5f8b0dcd33c249e553ea0be87778f2479
---

 libavcodec/8bps.c |    4 ++--
 1 file 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;



More information about the ffmpeg-cvslog mailing list