diff --git a/pnginfo.c b/pnginfo.c
index 115c900..6fb10a2 100644
--- a/pnginfo.c
+++ b/pnginfo.c
@@ -396,7 +396,7 @@ pnginfo_displayfile (char *filename, int extractBitmap, int displayBitmap, int t
 	  // This currently only applies to runs on zeros -- I should one day add an
 	  // option to extend this to runs of other values as well
 	  runlen = 0;
-	  for (i = 0; i < rowbytes * height / info->channels; i += info->channels * bytespersample)
+	  for (i = 0; i < rowbytes * height; i += info->channels * bytespersample)
 	    {
 	      int scount, bcount, pixel;
 
