DO NOT MERGE Fix for CVE-2011-3045

Change-Id: Ia46a262f8c73ec8ad6634c5de5f776373c330061
diff --git a/pngrutil.c b/pngrutil.c
index dfa2c03..47c781c 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -264,8 +264,8 @@
       {
          if (output != 0 && output_size > count)
          {
-            int copy = output_size - count;
-            if (avail < copy) copy = avail;
+            png_size_t copy = output_size - count;
+            if ((png_size_t) avail < copy) copy = (png_size_t) avail;
             png_memcpy(output + count, png_ptr->zbuf, copy);
          }
          count += avail;