Module: ffmpeg
Branch: master
Commit: 78e2380a6d09e7a8b2a74d090abfb0a922e046f6

Author:    Ronald S. Bultje <[email protected]>
Committer: Ronald S. Bultje <[email protected]>
Date:      Mon Feb 21 13:44:37 2011 -0500

targa: prevent integer overflow in bufsize check.

---

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

diff --git a/libavcodec/targa.c b/libavcodec/targa.c
index 0892b6f..3c220f4 100644
--- a/libavcodec/targa.c
+++ b/libavcodec/targa.c
@@ -34,7 +34,7 @@ typedef struct TargaContext {
 } TargaContext;
 
 #define CHECK_BUFFER_SIZE(buf, buf_end, needed, where) \
-    if(buf + needed > buf_end){ \
+    if(needed > buf_end - buf){ \
         av_log(avctx, AV_LOG_ERROR, "Problem: unexpected end of data while 
reading " where "\n"); \
         return -1; \
     } \

_______________________________________________
ffmpeg-commits mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-commits

Reply via email to