Bug#333893: fails with multiple .sng files on the command line

2005-10-14 Thread Aaron Crane
Package: sng
Version: 1.0.2-3
Severity: normal
Tags: patch

When given multiple .sng files on the command line, sng will successfully
compile the first one, but subsequent files produce the error message
illegal repeated chunk for the first (IHDR) chunk in the file.  sng is
treating the previous file's IHDR chunk as the previous occurrence of this
chunk.

Fix: reset every chunk's seen-count when processing each file.  Patch
attached.


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (50, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages sng depends on:
ii  libc6   2.3.2.ds1-22 GNU C Library: Shared libraries an
ii  libpng12-0  1.2.8rel-1   PNG library - runtime
ii  zlib1g  1:1.2.2-4compression library - runtime

-- no debconf information

-- 
Aaron Crane
--- sngc.c.orig 2003-11-15 19:40:22.0 +
+++ sngc.c  2005-10-14 10:54:55.494052742 +0100
@@ -1769,6 +1769,16 @@
 
 write_transform_options = PNG_TRANSFORM_IDENTITY;
 
+/* initialize per-input-file chunk properties */
+{
+   chunkprops *pp;
+
+   for (pp = properties;
+pp  properties + sizeof(properties)/sizeof(chunkprops);
+pp++)
+   pp-count = 0;
+}
+
 /* interpret the following chunk specifications */
 prevchunk = NONE;
 while (get_token())


Bug#333893: fails with multiple .sng files on the command line

2005-10-14 Thread Wesley J. Landaker
package png
forwarded 333893 http://sng.sf.net
thanks

On Friday 14 October 2005 04:19, Aaron Crane wrote:
 When given multiple .sng files on the command line, sng will successfully
 compile the first one, but subsequent files produce the error message
 illegal repeated chunk for the first (IHDR) chunk in the file.  sng is
 treating the previous file's IHDR chunk as the previous occurrence of
 this chunk.

 Fix: reset every chunk's seen-count when processing each file.  Patch
 attached.

I forwarded this upstream, and I'll apply it in the Debian package next 
upload.

-- 
Wesley J. Landaker [EMAIL PROTECTED] xmpp:[EMAIL PROTECTED]
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2


pgp2KLcQhL4o5.pgp
Description: PGP signature