From: Emmanuel <emmanuel.law@gmail.com>
Date: Tue, 11 Oct 2016 19:08:03 +1300
Subject: Patch for security bug https://bugs.php.net/bug.php?id=73280

---
 src/gd_io_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gd_io_dp.c b/src/gd_io_dp.c
index 8dbcc62..0219733 100644
--- a/src/gd_io_dp.c
+++ b/src/gd_io_dp.c
@@ -266,7 +266,7 @@ static int dynamicGetbuf(gdIOCtxPtr ctx, void *buf, int len)
 	if(remain >= len) {
 		rlen = len;
 	} else {
-		if(remain == 0) {
+		if(remain <= 0) {
 			/* 2.0.34: EOF is incorrect. We use 0 for
 			 * errors and EOF, just like fileGetbuf,
 			 * which is a simple fread() wrapper.
