Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > 343d569428081b82d8a748abe059a14b > files > 2

swftools-0.9.2-7.1.mga5.src.rpm

From 392fb1f3cd9a5b167787c551615c651c3f5326f2 Mon Sep 17 00:00:00 2001
From: Matthias Kramm <kramm@quiss.org>
Date: Wed, 26 Apr 2017 09:08:44 -0700
Subject: [PATCH] Fix an off-by-one error in png.c

This aims to fix https://github.com/matthiaskramm/swftools/issues/14
---
 lib/png.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/png.c b/lib/png.c
index 44a4b425..4bf29585 100644
--- a/lib/png.c
+++ b/lib/png.c
@@ -499,7 +499,7 @@ EXPORT int png_load(const char*sname, unsigned*destwidth, unsigned*destheight, u
 	return 0;
     }
 
-    unsigned long long imagedatalen_64 = ((unsigned long long)header.width + 1) * header.height * bypp;
+    unsigned long long imagedatalen_64 = ((unsigned long long)header.width + 1) * header.height * bypp + 1;
     if(imagedatalen_64 > 0xffffffff)
 	return 0;
     unsigned long imagedatalen = (unsigned long)imagedatalen_64;
-- 
2.12.2