From 5654f15e56087986812c557412d558482383fc8b Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 17 Jul 2012 08:51:20 +0200 Subject: [PATCH] png: sysfatal, debug print to stderr instead of potentialy messing up output stream --- sys/src/cmd/jpg/readpng.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/src/cmd/jpg/readpng.c b/sys/src/cmd/jpg/readpng.c index 750a6009d..7be53bd74 100644 --- a/sys/src/cmd/jpg/readpng.c +++ b/sys/src/cmd/jpg/readpng.c @@ -175,6 +175,8 @@ unfilter(int alg, uchar *buf, uchar *up, int len, int bypp) int i; switch(alg){ + default: + fprint(2, "unknown filtering scheme %d\n", alg); case FilterNone: break; @@ -201,9 +203,6 @@ unfilter(int alg, uchar *buf, uchar *up, int len, int bypp) for(; i < len; ++i) buf[i] += paeth(buf[i-bypp], up[i], up[i-bypp]); break; - - default: - sysfatal("unknown filtering scheme %d\n", alg); } } @@ -312,7 +311,7 @@ scanbytes(ZlibW *z) else n = (dx+adx-1)/adx; if(n != 1 + (z->dx - (adam7[z->pass].x+1)) / adam7[z->pass].dx){ - print("%d/%d != 1+(%d-1)/%d = %d\n", + fprint(2, "%d/%d != 1+(%d-1)/%d = %d\n", z->dx - adam7[z->pass].x - 1 + adx, adx, z->dx - (adam7[z->pass].x+1), adam7[z->pass].dx, 1 + (z->dx - (adam7[z->pass].x+1)) / adam7[z->pass].dx);