shithub: riscv

Download patch

ref: 05c11fefe0c633ab061b9f69180593ed9cf073a2
parent: aa679157765fdaf3c2e2ae5dd7d016bd7acbed15
author: cinap_lenrek <[email protected]>
date: Mon Jul 16 22:17:42 EDT 2012

topng: fix bug causing bogus double insertion of filter alg byte

--- a/sys/src/cmd/jpg/writepng.c
+++ b/sys/src/cmd/jpg/writepng.c
@@ -79,7 +79,7 @@
 	pixwid = z->pixwid;
 	b = buf;
 	e = b+n;
-	while(b+pixwid <= e){
+	while(b+pixwid < e){	/* one less for filter alg byte */
 		if(z->y >= z->dy)
 			break;
 		if(z->x == 0)