From: Glenn Randers-P. <gl...@gm...> - 2008-08-19 22:39:50
|
On Tue, Aug 19, 2008 at 6:30 PM, Pierre Poissinger <pie...@gm...> wrote: > Could something like using fileno helps in such case ? > (aka: using fileno to check the pointer is really a file...) > [out of the blue patch - not tested, just compiled] > > diff --git a/pngwio.c b/pngwio.c > index 1afbe93..4ed0609 100644 > --- a/pngwio.c > +++ b/pngwio.c > @@ -137,7 +137,7 @@ png_default_flush(png_structp png_ptr) > if (png_ptr == NULL) return; > #if !defined(_WIN32_WCE) > io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); > - if (io_ptr != NULL) > + if (io_ptr != NULL && fileno(io_ptr)!=-1) > fflush(io_ptr); > #endif > } We can try this in libpng-1.4.0betaNN It would probably be best to simply revert 1.2.31 to the 1.2.29 behavior, in which PNG_READ_FLUSH_SUPPORTED is "on" but one of the "png_flush()" calls is not present. Glenn |