• G
    [devel] Reverted changes to call png_longjmp in contrib/gregbook · 73e28ef1
    Glenn Randers-Pehrson 提交于
    where it is not appropriate.  If mainprog->jmpbuf is used by setjmp,
    then png_longjmp cannot be used.
    Reversed patch to remove error handler when the jmp_buf is stored in the
    main program structure, not the png_struct.
    The error handler is needed because the default handler in libpng will
    always use the jmp_buf in the library control structure; this is never
    set.  The gregbook code is a useful example because, even though it
    uses setjmp/longjmp, it shows how error handling can be implemented
    using control mechanisms not directly supported by libpng.  The
    technique will work correctly with mechanisms such as Microsoft
    Structure Exceptions or C++ exceptions (compiler willing - note that gcc
    does not by default support interworking of C and C++ error handling.)
    73e28ef1
writepng.c 13.0 KB