[libav-devel] [PATCH 1/5] pngdsp: fix (un)signed type in end comparission

Vittorio Giovara vittorio.giovara at gmail.com
Wed Nov 27 17:11:40 CET 2013


From: Michael Niedermayer <michaelni at gmx.at>

Fixes out of array accesses.

Found_by: ami_stuff
---
 libavcodec/pngdsp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/pngdsp.c b/libavcodec/pngdsp.c
index afd9093..5cc41c4 100644
--- a/libavcodec/pngdsp.c
+++ b/libavcodec/pngdsp.c
@@ -31,7 +31,7 @@
 static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w)
 {
     long i;
-    for (i = 0; i <= w - sizeof(long); i += sizeof(long)) {
+    for (i = 0; i <= w - (int)sizeof(long); i += sizeof(long)) {
         long a = *(long *)(src1 + i);
         long b = *(long *)(src2 + i);
         *(long *)(dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);
-- 
1.7.9.5



More information about the libav-devel mailing list