From a0eb3695778ead0829cf81966fbe5904dfcaa7b0 Mon Sep 17 00:00:00 2001 From: Per Hedbor <ph@opera.com> Date: Mon, 10 Apr 2000 03:18:45 +0200 Subject: [PATCH] Fixed the PNG bug (again) Rev: src/modules/Image/encodings/png.c:1.30 --- src/modules/Image/encodings/png.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/modules/Image/encodings/png.c b/src/modules/Image/encodings/png.c index 2edb0bd262..6f88df8a3a 100644 --- a/src/modules/Image/encodings/png.c +++ b/src/modules/Image/encodings/png.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: png.c,v 1.29 2000/03/25 18:18:21 per Exp $"); +RCSID("$Id: png.c,v 1.30 2000/04/10 01:18:45 per Exp $"); #include "image_machine.h" @@ -1150,17 +1150,18 @@ static void img_png_decode(INT32 args,int header_only) push_int(ct->u.flat.entries[(int)b->item[1].u.string->str[0]].color.g); push_int(ct->u.flat.entries[(int)b->item[1].u.string->str[0]].color.b); } - break; + break; default: - if (b->item[1].u.string->len!=6) + if (b->item[1].u.string->len==6) { int j; for (j=0; j<3; j++) { - int z=_png_c16(b->item[1].u.string->str[j],ihdr.bpp); + int z=_png_c16(b->item[1].u.string->str[j*2],ihdr.bpp); push_int(z); } - } + } else + continue; break; } f_aggregate(3); -- GitLab