Small bug in subgen-image.c

Niels Horn <[email protected]>
Newsgroups gmane.comp.multimedia.dvdauthor.user
Message-ID <[email protected]>
Hi,

I've been using dvdauthor in combination with tovid and discovered
that it sometimes gives an error about png images being too big, while
they aren't.

This seems to be caused by the new libpng library.

The following patch (against the stable 0.6.18 version) solves it:



--- dvdauthor/src/subgen-image.c        2010-03-13 05:14:07.000000000 -0300
+++ dvdauthor_patched/src/subgen-image.c        2010-06-11
08:10:04.000000000 -0300
@@ -226,7 +226,7 @@
     png_struct *ps;
     png_info *pi;
     png_byte **rowp;
-    unsigned long width,height;
+    png_uint_32 width,height;
     int bit_depth,color_type,channels,x,y;

     fp=fopen(s->fname,"rb");
@@ -271,7 +271,7 @@
     assert(bit_depth==8); // 8bpp, not 1, 2, 4, or 16
     assert(!(color_type&PNG_COLOR_MASK_PALETTE)); // not a palette
     if( width>MAXX || height>MAXY ) {
-        fprintf(stderr,"ERR: PNG %s is too big:
%lux%lu\n",s->fname,width,height);
+        fprintf(stderr,"ERR: PNG %s is too big:
%lux%lu\n",s->fname,(long unsigned int)width,(long unsigned
int)height);
         png_destroy_read_struct(&ps,&pi,NULL);
         return -1;
     }



Thanks,


Niels Horn
Rio de Janeiro, RJ
Brasil
site: www.nielshorn.net
e-mail: [email protected]

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.