#7129: libpng-1.6.19
-------------------------+--------------------------
 Reporter:  fo           |       Owner:  blfs-book@…
     Type:  enhancement  |      Status:  new
 Priority:  high         |   Milestone:  7.9
Component:  BOOK         |     Version:  SVN
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+--------------------------

Comment (by fo):

 I am worried, because this is a vulnerability fix.

 Not yet available libpng-1.6.19-apng.patch.gz at the unusual URL:

 [http://downloads.sourceforge.net/libpng-apng/libpng-1.6.19-apng.patch.gz]

 This has occurred a couple of times, before.

 Gentoo is using a patch from

 
[http://downloads.sourceforge.net/project/apng/libpng/libpng16/libpng-1.6.19-apng.patch.gz]

 ISTR having done that before, when the usual one was too much delayed, and
 later fixing back the book.

 Before comparing the two patches, my question is '''should we temporarily
 use the latter patch?'''

 I have downloaded version 1.6.18, for comparison.

 A diff between the patches is difficult to understand, because modified
 files are not at the same order. Another problem is that the unusual patch
 needs to be applied with ''p0'', not ''p1''.

 Another test I did was to apply each patch and diff the two patched codes:

 {{{
 --- libpng-1.6.18.new/LICENSE   2015-11-14 07:31:41.227754213 -0300
 +++ libpng-1.6.18.usual/LICENSE 2015-07-23 00:36:41.000000000 -0300
 -This modified version of libpng code adds animated PNG support. This code
 is
 -released under the libpng license described below. The modifications are
 -Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2015 Max Stepin,
 -and can be identified by "#ifdef PNG_APNG_SUPPORTED / #endif" directives
 -surrounding them in the modified libpng source files.
 -
 --- libpng-1.6.18.new/pngget.c  2015-11-14 07:31:41.228754190 -0300
 +++ libpng-1.6.18.usual/pngget.c        2015-11-14 07:32:16.602930736
 -0300
 -        (info_ptr->valid & PNG_INFO_acTL) != 0 &&
 +        (info_ptr->valid & PNG_INFO_acTL) &&
 -        (info_ptr->valid & PNG_INFO_fcTL) != 0 &&
 +        (info_ptr->valid & PNG_INFO_fcTL) &&
 -#endif /* APNG */
 +#endif /* PNG_APNG_SUPPORTED */
 --- libpng-1.6.18.new/png.h     2015-11-14 07:31:41.229754167 -0300
 +++ libpng-1.6.18.usual/png.h   2015-11-14 07:32:16.601930759 -0300
 - * This modified version of libpng code adds animated PNG support. This
 code is
 - * released under the libpng license described below. The modifications
 are
 - * Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2015 Max
 Stepin,
 - * and can be identified by "#ifdef PNG_APNG_SUPPORTED / #endif"
 directives
 - * surrounding them in the modified libpng source files.
 - *
 -#endif /* APNG */
 +#endif /* PNG_APNG_SUPPORTED */
 -
 -#endif /* PROGRESSIVE_READ */
 -#endif /* READ_APNG */
 +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 +#endif /* PNG_READ_APNG_SUPPORTED */
 -#endif /* WRITE_APNG */
 -#endif /* APNG */
 +#endif /* PNG_WRITE_APNG_SUPPORTED */
 +#endif /* PNG_APNG_SUPPORTED */
 -#endif /* APNG */
 +#endif /* PNG_APNG_SUPPORTED */
 --- libpng-1.6.18.new/pngpread.c        2015-11-14 07:31:41.231754120
 -0300
 +++ libpng-1.6.18.usual/pngpread.c      2015-11-14 07:32:16.603930713
 -0300
 -         if ((png_ptr->mode & PNG_HAVE_fcTL) != 0 ||
 -             png_ptr->num_frames_read > 1)
 +         if (png_ptr->mode & PNG_HAVE_fcTL || png_ptr->num_frames_read >
 1)
 -         PNG_PUSH_SAVE_BUFFER_IF_FULL
 -         png_crc_finish(png_ptr, png_ptr->push_length);
 +         if (png_ptr->push_length + 4 > png_ptr->buffer_size)
 +         {
 +            png_push_save_buffer(png_ptr);
 +            return;
 +         }
 +
 +         return;
 -
 -         PNG_PUSH_SAVE_BUFFER_IF_LT(4)
 +         if (png_ptr->buffer_size < 4)
 +         {
 +            png_push_save_buffer(png_ptr);
 +            return;
 +         }
 +
 -         if ((png_ptr->mode & PNG_HAVE_fcTL) == 0)
 +         if (!(png_ptr->mode & PNG_HAVE_fcTL))
 -            PNG_PUSH_SAVE_BUFFER_IF_FULL
 -            png_crc_finish(png_ptr, png_ptr->push_length);
 +            if (png_ptr->push_length + 4 > png_ptr->buffer_size)
 +            {
 +               png_push_save_buffer(png_ptr);
 +               return;
 +            }
 +
 +            return;
 +
 +            return;
 -         PNG_PUSH_SAVE_BUFFER_IF_FULL
 +         if (png_ptr->push_length + 4 > png_ptr->buffer_size)
 +         {
 +            png_push_save_buffer(png_ptr);
 +            return;
 +         }
 +
 -         if ((png_ptr->mode & PNG_HAVE_fcTL) == 0)
 +         if (!(png_ptr->mode & PNG_HAVE_fcTL))
 -      }
 -      else if (chunk_name == png_IEND)
 -      {
 -         PNG_PUSH_SAVE_BUFFER_IF_FULL
 -         png_warning(png_ptr, "Number of actual frames fewer than
 expected");
 -         png_crc_finish(png_ptr, png_ptr->push_length);
 -         png_ptr->process_mode = PNG_READ_DONE_MODE;
 -         png_push_have_end(png_ptr, info_ptr);
 +         return;
 -         PNG_PUSH_SAVE_BUFFER_IF_FULL
 +         if (png_ptr->push_length + 4 > png_ptr->buffer_size)
 +         {
 +            png_push_save_buffer(png_ptr);
 +            return;
 +         }
 -         png_crc_finish(png_ptr, png_ptr->push_length);
 +         return;
 -#endif /* READ_APNG */
 +#endif /* PNG_READ_APNG_SUPPORTED */
 -
 -      PNG_PUSH_SAVE_BUFFER_IF_FULL
 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
 +      {
 +         png_push_save_buffer(png_ptr);
 +         return;
 +      }
 +
 -      PNG_PUSH_SAVE_BUFFER_IF_FULL
 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
 +      {
 +         png_push_save_buffer(png_ptr);
 +         return;
 +      }
 +
 -#endif /* READ_APNG */
 +#endif /* PNG_READ_APNG_SUPPORTED */
 +
 -          if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) != 0)
 +          if (png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED)
 -              PNG_PUSH_SAVE_BUFFER_IF_FULL
 +              if (png_ptr->push_length + 4 > png_ptr->buffer_size)
 +              {
 +                 png_push_save_buffer(png_ptr);
 +                 return;
 +              }
 -   if ((png_ptr->apng_flags & PNG_APNG_APP) == 0 &&
 -      png_ptr->num_frames_read > 0)
 +   if (!(png_ptr->apng_flags & PNG_APNG_APP) && png_ptr->num_frames_read
 > 0)
 -      png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
 -      return;
 +     png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
 +     return;
 --- libpng-1.6.18.new/pngpriv.h 2015-11-14 07:31:41.230754143 -0300
 +++ libpng-1.6.18.usual/pngpriv.h       2015-11-14 07:32:16.605930666
 -0300
 +/* Added at libpng version 1.6.0 */
 +#ifdef PNG_GAMMA_SUPPORTED
 +PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp
 png_ptr,
 +    png_colorspacerp colorspace, png_fixed_point gAMA), PNG_EMPTY);
 +   /* Set the colorspace gamma with a value provided by the application
 or by
 +    * the gAMA chunk on read.  The value will override anything set by an
 ICC
 +    * profile.
 +    */
 +
 +PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp
 png_ptr,
 +    png_inforp info_ptr), PNG_EMPTY);
 +    /* Synchronize the info 'valid' flags with the colorspace */
 +
 +PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp
 png_ptr,
 +    png_inforp info_ptr), PNG_EMPTY);
 +    /* Copy the png_struct colorspace to the info_struct and call the
 above to
 +     * synchronize the flags.  Checks for NULL info_ptr and does nothing.
 +     */
 +#endif
 +
 -   png_byte dispose_op, png_byte blend_op),PNG_EMPTY);
 +   png_byte dispose_op, png_byte blend_op), PNG_EMPTY);
 -PNG_INTERNAL_FUNCTION(void,png_handle_acTL,(png_structp png_ptr,
 -   png_infop info_ptr, png_uint_32 length),PNG_EMPTY);
 -PNG_INTERNAL_FUNCTION(void,png_handle_fcTL,(png_structp png_ptr,
 -   png_infop info_ptr, png_uint_32 length),PNG_EMPTY);
 -PNG_INTERNAL_FUNCTION(void,png_handle_fdAT,(png_structp png_ptr,
 -   png_infop info_ptr, png_uint_32 length),PNG_EMPTY);
 -PNG_INTERNAL_FUNCTION(void,png_have_info,(png_structp png_ptr,
 -   png_infop info_ptr),PNG_EMPTY);
 +PNG_INTERNAL_FUNCTION(void,png_handle_acTL,(png_structp png_ptr,
 png_infop info_ptr,
 +   png_uint_32 length),PNG_EMPTY);
 +PNG_INTERNAL_FUNCTION(void,png_handle_fcTL,(png_structp png_ptr,
 png_infop info_ptr,
 +   png_uint_32 length),PNG_EMPTY);
 +PNG_INTERNAL_FUNCTION(void,png_handle_fdAT,(png_structp png_ptr,
 png_infop info_ptr,
 +   png_uint_32 length),PNG_EMPTY);
 +PNG_INTERNAL_FUNCTION(void,png_have_info,(png_structp png_ptr, png_infop
 info_ptr),PNG_EMPTY);
 -PNG_INTERNAL_FUNCTION(void,png_progressive_read_reset,(png_structp
 png_ptr),
 -   PNG_EMPTY);
 -#endif /* PROGRESSIVE_READ */
 -#endif /* READ_APNG */
 +PNG_INTERNAL_FUNCTION(void,png_progressive_read_reset,(png_structp
 png_ptr),PNG_EMPTY);
 +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 +#endif /* PNG_READ_APNG_SUPPORTED */
 -#endif /* WRITE_APNG */
 -#endif /* APNG */
 -
 -/* Added at libpng version 1.6.0 */
 -#ifdef PNG_GAMMA_SUPPORTED
 -PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp
 png_ptr,
 -    png_colorspacerp colorspace, png_fixed_point gAMA), PNG_EMPTY);
 -   /* Set the colorspace gamma with a value provided by the application
 or by
 -    * the gAMA chunk on read.  The value will override anything set by an
 ICC
 -    * profile.
 -    */
 -
 -PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp
 png_ptr,
 -    png_inforp info_ptr), PNG_EMPTY);
 -    /* Synchronize the info 'valid' flags with the colorspace */
 -
 -PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp
 png_ptr,
 -    png_inforp info_ptr), PNG_EMPTY);
 -    /* Copy the png_struct colorspace to the info_struct and call the
 above to
 -     * synchronize the flags.  Checks for NULL info_ptr and does nothing.
 -     */
 -#endif
 +#endif /* PNG_WRITE_APNG_SUPPORTED */
 +#endif /* PNG_APNG_SUPPORTED */
 --- libpng-1.6.18.new/pngread.c 2015-11-14 07:31:41.228754190 -0300
 +++ libpng-1.6.18.usual/pngread.c       2015-11-14 07:32:16.606930644
 -0300
 -    if ((png_ptr->mode & PNG_HAVE_acTL) == 0)
 +    if (!(png_ptr->mode & PNG_HAVE_acTL))
 -            if (have_chunk_after_DAT != 0 || png_ptr->num_frames_read >
 1)
 +            if (have_chunk_after_DAT || png_ptr->num_frames_read > 1)
 -            if (have_chunk_after_DAT == 0 && png_ptr->num_frames_read >
 1)
 +            if (!have_chunk_after_DAT && png_ptr->num_frames_read > 1)
 -#endif /* READ_APNG */
 +#endif /* PNG_READ_APNG_SUPPORTED */
 --- libpng-1.6.18.new/pngrutil.c        2015-11-14 07:31:41.233754073
 -0300
 +++ libpng-1.6.18.usual/pngrutil.c      2015-11-14 07:32:16.608930597
 -0300
 -    if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
 +    if (!(png_ptr->mode & PNG_HAVE_IHDR))
 -    else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
 +    else if (png_ptr->mode & PNG_HAVE_IDAT)
 -    else if ((png_ptr->mode & PNG_HAVE_acTL) != 0)
 +    else if (png_ptr->mode & PNG_HAVE_acTL)
 -    if (didSet != 0)
 +    if(didSet)
 -    if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
 +    if (!(png_ptr->mode & PNG_HAVE_IHDR))
 -    else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
 +    else if (png_ptr->mode & PNG_HAVE_IDAT)
 -    else if ((png_ptr->mode & PNG_HAVE_fcTL) != 0)
 +    else if (png_ptr->mode & PNG_HAVE_fcTL)
 -    if ((info_ptr->valid & PNG_INFO_acTL) != 0 &&
 -        (info_ptr->valid & PNG_INFO_fcTL) == 0)
 +    if((info_ptr->valid & PNG_INFO_acTL) && !(info_ptr->valid &
 PNG_INFO_fcTL))
 -#endif /* READ_APNG */
 +#endif /* PNG_READ_APNG_SUPPORTED */
 -
 -#endif /* READ_APNG */
 -
 +#endif /* PNG_READ_APNG_SUPPORTED */
 -    if (png_ptr->prev_row != NULL)
 +    if (png_ptr->prev_row)
 -    /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index
 */
 +   /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index
 */
 -    /* Start of interlace block */
 -    static PNG_CONST png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
 +   /* Start of interlace block */
 +    const int png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
 -    static PNG_CONST png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
 +    const int png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
 -    static PNG_CONST png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
 +    const int png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
 -    static PNG_CONST png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
 +    const int png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
 -    if (png_ptr->interlaced != 0)
 +    if (png_ptr->interlaced)
 -        if ((png_ptr->transformations & PNG_INTERLACE) == 0)
 +        if (!(png_ptr->transformations & PNG_INTERLACE))
 -#endif /* READ_INTERLACING */
 +#endif /* PNG_READ_INTERLACING_SUPPORTED */
 -#endif /* PROGRESSIVE_READ */
 -#endif /* READ_APNG */
 +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 +#endif /* PNG_READ_APNG_SUPPORTED */
 --- libpng-1.6.18.new/pngset.c  2015-11-14 07:31:41.232754097 -0300
 +++ libpng-1.6.18.usual/pngset.c        2015-11-14 07:32:16.609930575
 -0300
 -                    "Ignoring attempt to set acTL with num_plays >
 2^31-1");
 +                    "Ignoring attempt to set acTL with num_plays "
 +                    "> 2^31-1");
 -        if ((png_ptr->color_type & PNG_COLOR_MASK_ALPHA) == 0 &&
 -            png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) == 0)
 +        if (!(png_ptr->color_type & PNG_COLOR_MASK_ALPHA) &&
 +            !(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)))
 -        png_error(png_ptr, "dimensions of a frame are greater than "
 +        png_error(png_ptr, "dimensions of a frame are greater than"
 -    if (is_hidden != 0)
 +    if (is_hidden)
 -#endif /* APNG */
 +#endif /* PNG_APNG_SUPPORTED */
 --- libpng-1.6.18.new/pngstruct.h       2015-11-14 07:31:41.230754143
 -0300
 +++ libpng-1.6.18.usual/pngstruct.h     2015-11-14 07:32:16.609930575
 -0300
 -#endif /* APNG */
 +#endif /* PNG_APNG_SUPPORTED */
 --- libpng-1.6.18.new/pngtest.c 2015-07-23 00:36:41.000000000 -0300
 +++ libpng-1.6.18.usual/pngtest.c       2015-11-14 07:32:16.610930551
 -0300
 +#ifdef PNG_APNG_SUPPORTED
 +   png_uint_32 num_frames;
 +   png_uint_32 num_plays;
 +#endif
 +#ifdef PNG_APNG_SUPPORTED
 +   if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL))
 +   {
 +      if (png_get_acTL(read_ptr, read_info_ptr, &num_frames, &num_plays))
 +      {
 +         png_byte is_hidden;
 +         pngtest_debug2("Handling acTL chunks (frames %ld, plays %ld)",
 +                    num_frames, num_plays);
 +         png_set_acTL(write_ptr, write_info_ptr, num_frames, num_plays);
 +         is_hidden = png_get_first_frame_is_hidden(read_ptr,
 read_info_ptr);
 +         png_set_first_frame_is_hidden(write_ptr, write_info_ptr,
 is_hidden);
 +      }
 +   }
 +#endif
 +#ifdef PNG_APNG_SUPPORTED
 +   if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL))
 +   {
 +      png_uint_32 frame;
 +      for (frame = 0; frame < num_frames; frame++)
 +      {
 +         png_uint_32 frame_width;
 +         png_uint_32 frame_height;
 +         png_uint_32 x_offset;
 +         png_uint_32 y_offset;
 +         png_uint_16 delay_num;
 +         png_uint_16 delay_den;
 +         png_byte dispose_op;
 +         png_byte blend_op;
 +         png_read_frame_head(read_ptr, read_info_ptr);
 +         if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_fcTL))
 +         {
 +            png_get_next_frame_fcTL(read_ptr, read_info_ptr,
 +                                    &frame_width, &frame_height,
 +                                    &x_offset, &y_offset,
 +                                    &delay_num, &delay_den,
 +                                    &dispose_op, &blend_op);
 +         }
 +         else
 +         {
 +            frame_width = width;
 +            frame_height = height;
 +            x_offset = 0;
 +            y_offset = 0;
 +            delay_num = 1;
 +            delay_den = 1;
 +            dispose_op = PNG_DISPOSE_OP_NONE;
 +            blend_op = PNG_BLEND_OP_SOURCE;
 +         }
 +#ifdef PNG_WRITE_APNG_SUPPORTED
 +         png_write_frame_head(write_ptr, write_info_ptr,
 (png_bytepp)&row_buf,
 +                              frame_width, frame_height,
 +                              x_offset, y_offset,
 +                              delay_num, delay_den,
 +                              dispose_op, blend_op);
 +#endif
 +         for (pass = 0; pass < num_pass; pass++)
 +         {
 +            pngtest_debug1("Writing row data for pass %d", pass);
 +            for (y = 0; y < frame_height; y++)
 +            {
 +#ifndef SINGLE_ROWBUF_ALLOC
 +               pngtest_debug2("Allocating row buffer (pass %d, y =
 %ld)...", pass, y);
 +               row_buf = (png_bytep)png_malloc(read_ptr,
 +                  png_get_rowbytes(read_ptr, read_info_ptr));
 +               pngtest_debug2("0x%08lx (%ld bytes)", (unsigned
 long)row_buf,
 +                  png_get_rowbytes(read_ptr, read_info_ptr));
 +#endif /* !SINGLE_ROWBUF_ALLOC */
 +               png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1);
 +
 +#ifdef PNG_WRITE_SUPPORTED
 +#ifdef PNGTEST_TIMING
 +               t_stop = (float)clock();
 +               t_decode += (t_stop - t_start);
 +               t_start = t_stop;
 +#endif
 +               png_write_rows(write_ptr, (png_bytepp)&row_buf, 1);
 +#ifdef PNGTEST_TIMING
 +               t_stop = (float)clock();
 +               t_encode += (t_stop - t_start);
 +               t_start = t_stop;
 +#endif
 +#endif /* PNG_WRITE_SUPPORTED */
 +
 +#ifndef SINGLE_ROWBUF_ALLOC
 +               pngtest_debug2("Freeing row buffer (pass %d, y = %ld)",
 pass, y);
 +               png_free(read_ptr, row_buf);
 +               row_buf = NULL;
 +#endif /* !SINGLE_ROWBUF_ALLOC */
 +            }
 +         }
 +#ifdef PNG_WRITE_APNG_SUPPORTED
 +         png_write_frame_tail(write_ptr, write_info_ptr);
 +#endif
 +      }
 +   }
 +   else
 +#endif
 --- libpng-1.6.18.new/pngwrite.c        2015-11-14 07:31:41.231754120
 -0300
 +++ libpng-1.6.18.usual/pngwrite.c      2015-11-14 07:32:16.610930551
 -0300
 -   if ((info_ptr->valid & PNG_INFO_acTL) != 0)
 -      png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays);
 +      if (info_ptr->valid & PNG_INFO_acTL)
 +         png_write_acTL(png_ptr, info_ptr->num_frames,
 info_ptr->num_plays);
 -#ifdef PNG_WRITE_APNG_SUPPORTED
 -   if (png_ptr->num_frames_written != png_ptr->num_frames_to_write)
 -      png_error(png_ptr, "Not enough frames written");
 -#endif
 -
 +#ifdef PNG_WRITE_APNG_SUPPORTED
 +   if (png_ptr->num_frames_written != png_ptr->num_frames_to_write)
 +      png_error(png_ptr, "Not enough frames written");
 +#endif
 +
 +#ifdef PNG_WRITE_APNG_SUPPORTED
 +void PNGAPI
 +png_write_frame_head(png_structp png_ptr, png_infop info_ptr,
 +    png_bytepp row_pointers, png_uint_32 width, png_uint_32 height,
 +    png_uint_32 x_offset, png_uint_32 y_offset,
 +    png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op,
 +    png_byte blend_op)
 +{
 +    png_debug(1, "in png_write_frame_head");
 +
 +    /* there is a chance this has been set after png_write_info was
 called,
 +    * so it would be set but not written. is there a way to be sure? */
 +    if (!(info_ptr->valid & PNG_INFO_acTL))
 +        png_error(png_ptr, "png_write_frame_head(): acTL not set");
 +
 +    png_write_reset(png_ptr);
 +
 +    png_write_reinit(png_ptr, info_ptr, width, height);
 +
 +    if ( !(png_ptr->num_frames_written == 0 &&
 +           (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) ) )
 +        png_write_fcTL(png_ptr, width, height, x_offset, y_offset,
 +                       delay_num, delay_den, dispose_op, blend_op);
 +
 +    PNG_UNUSED(row_pointers)
 +}
 +
 +void PNGAPI
 +png_write_frame_tail(png_structp png_ptr, png_infop info_ptr)
 +{
 +    png_debug(1, "in png_write_frame_tail");
 +
 +    png_ptr->num_frames_written++;
 +
 +    PNG_UNUSED(info_ptr)
 +}
 +#endif /* PNG_WRITE_APNG_SUPPORTED */
 -
 -#ifdef PNG_WRITE_APNG_SUPPORTED
 -void PNGAPI
 -png_write_frame_head(png_structp png_ptr, png_infop info_ptr,
 -    png_bytepp row_pointers, png_uint_32 width, png_uint_32 height,
 -    png_uint_32 x_offset, png_uint_32 y_offset,
 -    png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op,
 -    png_byte blend_op)
 -{
 -    png_debug(1, "in png_write_frame_head");
 -
 -    /* there is a chance this has been set after png_write_info was
 called,
 -    * so it would be set but not written. is there a way to be sure? */
 -    if ((info_ptr->valid & PNG_INFO_acTL) == 0)
 -        png_error(png_ptr, "png_write_frame_head(): acTL not set");
 -
 -    png_write_reset(png_ptr);
 -
 -    png_write_reinit(png_ptr, info_ptr, width, height);
 -
 -    if ((png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) == 0 ||
 -        png_ptr->num_frames_written != 0)
 -        png_write_fcTL(png_ptr, width, height, x_offset, y_offset,
 -                       delay_num, delay_den, dispose_op, blend_op);
 -
 -    PNG_UNUSED(row_pointers)
 -}
 -
 -void PNGAPI
 -png_write_frame_tail(png_structp png_ptr, png_infop info_ptr)
 -{
 -    png_debug(1, "in png_write_frame_tail");
 -
 -    png_ptr->num_frames_written++;
 -
 -    PNG_UNUSED(info_ptr)
 -}
 -#endif /* WRITE_APNG */
 --- libpng-1.6.18.new/pngwutil.c        2015-11-14 07:31:41.233754073
 -0300
 +++ libpng-1.6.18.usual/pngwutil.c      2015-11-14 07:32:16.610930551
 -0300
 -#ifdef PNG_WRITE_APNG_SUPPORTED
 -         if (png_ptr->num_frames_written == 0)
 -#endif
 +#        ifdef PNG_WRITE_APNG_SUPPORTED
 +            if (png_ptr->num_frames_written == 0)
 +#        endif
 -#ifdef PNG_WRITE_APNG_SUPPORTED
 -         else
 -            png_write_fdAT(png_ptr, data, size);
 -#endif /* WRITE_APNG */
 -
 +#        ifdef PNG_WRITE_APNG_SUPPORTED
 +            else
 +               png_write_fdAT(png_ptr, data, size);
 +#        endif /* PNG_WRITE_APNG_SUPPORTED */
 -#ifdef PNG_WRITE_APNG_SUPPORTED
 -         if (png_ptr->num_frames_written == 0)
 -#endif
 +#        ifdef PNG_WRITE_APNG_SUPPORTED
 +            if (png_ptr->num_frames_written == 0)
 +#        endif
 -#ifdef PNG_WRITE_APNG_SUPPORTED
 -         else
 -            png_write_fdAT(png_ptr, data, size);
 -#endif /* WRITE_APNG */
 +#        ifdef PNG_WRITE_APNG_SUPPORTED
 +            else
 +               png_write_fdAT(png_ptr, data, size);
 +#        endif /* PNG_WRITE_APNG_SUPPORTED */
 -    if ((png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) != 0)
 +    if (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN)
 -#endif /* WRITE_APNG */
 +#endif /* PNG_WRITE_APNG_SUPPORTED */
 -        png_error(png_ptr, "width and/or height for a frame greater than
 "
 +        png_error(png_ptr, "width and/or height for a frame greater than"
 -#endif /* WRITE_APNG */
 +#endif /* PNG_WRITE_APNG_SUPPORTED */
 }}}

--
Ticket URL: <http://wiki.linuxfromscratch.org/blfs/ticket/7129#comment:2>
BLFS Trac <http://wiki.linuxfromscratch.org/blfs>
Beyond Linux From Scratch
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to