Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 824018
Collapse All | Expand All

(-)file_not_specified_in_diff (-64 / +98 lines)
Line  Link Here
0
-- png.c
0
++ png.c
Lines 4607-4609 Link Here
4607
4607
4608
#endif /* SIMPLIFIED READ/WRITE */
4608
#endif /* SIMPLIFIED READ/WRITE */
4609
#endif /* READ || WRITE */
4609
#endif /* READ || WRITE */
4610
-- png.h
4610
4611
/* ANIMATED PNG SUPPORT */
4612
#ifdef PNG_APNG_SUPPORTED
4613
int PNG_APNG_USED = 1;
4614
4615
void PNGAPI
4616
png_use_apng(int use)
4617
{
4618
   PNG_APNG_USED = use;
4619
}
4620
#endif /* APNG */
4621
++ png.h
Lines 3324-3329 Link Here
3324
PNG_EXPORT(267, void, png_write_frame_tail, (png_structp png_ptr,
3324
PNG_EXPORT(267, void, png_write_frame_tail, (png_structp png_ptr,
3325
   png_infop info_ptr));
3325
   png_infop info_ptr));
3326
#endif /* WRITE_APNG */
3326
#endif /* WRITE_APNG */
3327
3328
PNG_EXPORT(268, void, png_use_apng, (int use));
3327
#endif /* APNG */
3329
#endif /* APNG */
3328
3330
3329
/* Maintainer: Put new public prototypes here ^, in libpng.3, in project
3331
/* Maintainer: Put new public prototypes here ^, in libpng.3, in project
Lines 3335-3341 Link Here
3335
 */
3337
 */
3336
#ifdef PNG_EXPORT_LAST_ORDINAL
3338
#ifdef PNG_EXPORT_LAST_ORDINAL
3337
#ifdef PNG_APNG_SUPPORTED
3339
#ifdef PNG_APNG_SUPPORTED
3338
  PNG_EXPORT_LAST_ORDINAL(269);
3340
  PNG_EXPORT_LAST_ORDINAL(270);
3339
#else
3341
#else
3340
  PNG_EXPORT_LAST_ORDINAL(249);
3342
  PNG_EXPORT_LAST_ORDINAL(249);
3341
#endif /* APNG */
3343
#endif /* APNG */
3342
-- pngpread.c
3344
++ pngpread.c
Lines 196-202 Link Here
196
   chunk_name = png_ptr->chunk_name;
196
   chunk_name = png_ptr->chunk_name;
197
197
198
#ifdef PNG_READ_APNG_SUPPORTED
198
#ifdef PNG_READ_APNG_SUPPORTED
199
   if (png_ptr->num_frames_read > 0 &&
199
   if (PNG_APNG_USED && png_ptr->num_frames_read > 0 &&
200
       png_ptr->num_frames_read < info_ptr->num_frames)
200
       png_ptr->num_frames_read < info_ptr->num_frames)
201
   {
201
   {
202
      if (chunk_name == png_IDAT)
202
      if (chunk_name == png_IDAT)
Lines 345-351 Link Here
345
   else if (chunk_name == png_IDAT)
345
   else if (chunk_name == png_IDAT)
346
   {
346
   {
347
#ifdef PNG_READ_APNG_SUPPORTED
347
#ifdef PNG_READ_APNG_SUPPORTED
348
      png_have_info(png_ptr, info_ptr);
348
      if (PNG_APNG_USED)
349
         png_have_info(png_ptr, info_ptr);
349
#endif
350
#endif
350
      png_ptr->idat_size = png_ptr->push_length;
351
      png_ptr->idat_size = png_ptr->push_length;
351
      png_ptr->process_mode = PNG_READ_IDAT_MODE;
352
      png_ptr->process_mode = PNG_READ_IDAT_MODE;
Lines 494-506 Link Here
494
#endif
495
#endif
495
496
496
#ifdef PNG_READ_APNG_SUPPORTED
497
#ifdef PNG_READ_APNG_SUPPORTED
497
   else if (chunk_name == png_acTL)
498
   else if (PNG_APNG_USED && chunk_name == png_acTL)
498
   {
499
   {
499
      PNG_PUSH_SAVE_BUFFER_IF_FULL
500
      PNG_PUSH_SAVE_BUFFER_IF_FULL
500
      png_handle_acTL(png_ptr, info_ptr, png_ptr->push_length);
501
      png_handle_acTL(png_ptr, info_ptr, png_ptr->push_length);
501
   }
502
   }
502
503
503
   else if (chunk_name == png_fcTL)
504
   else if (PNG_APNG_USED && chunk_name == png_fcTL)
504
   {
505
   {
505
      PNG_PUSH_SAVE_BUFFER_IF_FULL
506
      PNG_PUSH_SAVE_BUFFER_IF_FULL
506
      png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length);
507
      png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length);
Lines 640-646 Link Here
640
641
641
      /* TODO: this code can be commoned up with the same code in push_read */
642
      /* TODO: this code can be commoned up with the same code in push_read */
642
#ifdef PNG_READ_APNG_SUPPORTED
643
#ifdef PNG_READ_APNG_SUPPORTED
643
      PNG_PUSH_SAVE_BUFFER_IF_LT(12)
644
      if (PNG_APNG_USED)
645
      {
646
         PNG_PUSH_SAVE_BUFFER_IF_LT(12)
647
      }
648
      else
649
      {
650
         PNG_PUSH_SAVE_BUFFER_IF_LT(8)
651
      }
644
#else
652
#else
645
      PNG_PUSH_SAVE_BUFFER_IF_LT(8)
653
      PNG_PUSH_SAVE_BUFFER_IF_LT(8)
646
#endif
654
#endif
Lines 652-658 Link Here
652
      png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
660
      png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
653
661
654
#ifdef PNG_READ_APNG_SUPPORTED
662
#ifdef PNG_READ_APNG_SUPPORTED
655
      if (png_ptr->chunk_name != png_fdAT && png_ptr->num_frames_read > 0)
663
      if (PNG_APNG_USED && png_ptr->chunk_name != png_fdAT && png_ptr->num_frames_read > 0)
656
      {
664
      {
657
          if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) != 0)
665
          if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) != 0)
658
          {
666
          {
Lines 677-683 Link Here
677
      else
685
      else
678
#endif
686
#endif
679
#ifdef PNG_READ_APNG_SUPPORTED
687
#ifdef PNG_READ_APNG_SUPPORTED
680
      if (png_ptr->chunk_name != png_IDAT && png_ptr->num_frames_read == 0)
688
      if (png_ptr->chunk_name != png_IDAT && (!PNG_APNG_USED || png_ptr->num_frames_read == 0))
681
#else
689
#else
682
      if (png_ptr->chunk_name != png_IDAT)
690
      if (png_ptr->chunk_name != png_IDAT)
683
#endif
691
#endif
Lines 688-696 Link Here
688
            png_error(png_ptr, "Not enough compressed data");
696
            png_error(png_ptr, "Not enough compressed data");
689
697
690
#ifdef PNG_READ_APNG_SUPPORTED
698
#ifdef PNG_READ_APNG_SUPPORTED
691
         if (png_ptr->frame_end_fn != NULL)
699
         if (PNG_APNG_USED)
692
            (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read);
700
         {
693
         png_ptr->num_frames_read++;
701
            if (png_ptr->frame_end_fn != NULL)
702
               (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read);
703
            png_ptr->num_frames_read++;
704
         }
694
#endif
705
#endif
695
706
696
         return;
707
         return;
Lines 699-705 Link Here
699
      png_ptr->idat_size = png_ptr->push_length;
710
      png_ptr->idat_size = png_ptr->push_length;
700
711
701
#ifdef PNG_READ_APNG_SUPPORTED
712
#ifdef PNG_READ_APNG_SUPPORTED
702
      if (png_ptr->num_frames_read > 0)
713
      if (PNG_APNG_USED && png_ptr->num_frames_read > 0)
703
      {
714
      {
704
         png_ensure_sequence_number(png_ptr, 4);
715
         png_ensure_sequence_number(png_ptr, 4);
705
         png_ptr->idat_size -= 4;
716
         png_ptr->idat_size -= 4;
Lines 780-786 Link Here
780
791
781
#ifdef PNG_READ_APNG_SUPPORTED
792
#ifdef PNG_READ_APNG_SUPPORTED
782
   /* If the app is not APNG-aware, decode only the first frame */
793
   /* If the app is not APNG-aware, decode only the first frame */
783
   if ((png_ptr->apng_flags & PNG_APNG_APP) == 0 &&
794
   if (PNG_APNG_USED && (png_ptr->apng_flags & PNG_APNG_APP) == 0 &&
784
      png_ptr->num_frames_read > 0)
795
      png_ptr->num_frames_read > 0)
785
   {
796
   {
786
      png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
797
      png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
787
-- pngpriv.h
798
++ pngpriv.h
Lines 2197-2202 Link Here
2197
                      PNG_EMPTY);
2197
                      PNG_EMPTY);
2198
#endif
2198
#endif
2199
2199
2200
#ifdef PNG_APNG_SUPPORTED
2201
extern int PNG_APNG_USED;
2202
#endif
2203
2200
/* Maintainer: Put new private prototypes here ^ */
2204
/* Maintainer: Put new private prototypes here ^ */
2201
2205
2202
#include "pngdebug.h"
2206
#include "pngdebug.h"
2203
-- pngread.c
2207
++ pngread.c
Lines 162-168 Link Here
162
      else if (chunk_name == png_IDAT)
162
      else if (chunk_name == png_IDAT)
163
      {
163
      {
164
#ifdef PNG_READ_APNG_SUPPORTED
164
#ifdef PNG_READ_APNG_SUPPORTED
165
         png_have_info(png_ptr, info_ptr);
165
         if (PNG_APNG_USED)
166
            png_have_info(png_ptr, info_ptr);
166
#endif
167
#endif
167
         png_ptr->idat_size = length;
168
         png_ptr->idat_size = length;
168
         break;
169
         break;
Lines 259-271 Link Here
259
#endif
260
#endif
260
261
261
#ifdef PNG_READ_APNG_SUPPORTED
262
#ifdef PNG_READ_APNG_SUPPORTED
262
      else if (chunk_name == png_acTL)
263
      else if (PNG_APNG_USED && chunk_name == png_acTL)
263
         png_handle_acTL(png_ptr, info_ptr, length);
264
         png_handle_acTL(png_ptr, info_ptr, length);
264
265
265
      else if (chunk_name == png_fcTL)
266
      else if (PNG_APNG_USED && chunk_name == png_fcTL)
266
         png_handle_fcTL(png_ptr, info_ptr, length);
267
         png_handle_fcTL(png_ptr, info_ptr, length);
267
268
268
      else if (chunk_name == png_fdAT)
269
      else if (PNG_APNG_USED && chunk_name == png_fdAT)
269
         png_handle_fdAT(png_ptr, info_ptr, length);
270
         png_handle_fdAT(png_ptr, info_ptr, length);
270
#endif
271
#endif
271
272
272
-- pngrutil.c
273
++ pngrutil.c
Lines 3342-3348 Link Here
3342
      limit = PNG_USER_CHUNK_MALLOC_MAX;
3342
      limit = PNG_USER_CHUNK_MALLOC_MAX;
3343
# endif
3343
# endif
3344
#ifdef PNG_READ_APNG_SUPPORTED
3344
#ifdef PNG_READ_APNG_SUPPORTED
3345
   if (png_ptr->chunk_name == png_IDAT || png_ptr->chunk_name == png_fdAT)
3345
   if (png_ptr->chunk_name == png_IDAT || (PNG_APNG_USED && png_ptr->chunk_name == png_fdAT))
3346
#else
3346
#else
3347
   if (png_ptr->chunk_name == png_IDAT)
3347
   if (png_ptr->chunk_name == png_IDAT)
3348
#endif
3348
#endif
Lines 4349-4398 Link Here
4349
         uInt avail_in;
4349
         uInt avail_in;
4350
         png_bytep buffer;
4350
         png_bytep buffer;
4351
4351
4352
#ifdef PNG_READ_APNG_SUPPORTED
4352
         if (PNG_APNG_USED)
4353
         png_uint_32 bytes_to_skip = 0;
4354
4355
         while (png_ptr->idat_size == 0 || bytes_to_skip != 0)
4356
         {
4353
         {
4357
            png_crc_finish(png_ptr, bytes_to_skip);
4354
            png_uint_32 bytes_to_skip = 0;
4358
            bytes_to_skip = 0;
4359
4355
4360
            png_ptr->idat_size = png_read_chunk_header(png_ptr);
4356
            while (png_ptr->idat_size == 0 || bytes_to_skip != 0)
4361
            if (png_ptr->num_frames_read == 0)
4362
            {
4357
            {
4363
               if (png_ptr->chunk_name != png_IDAT)
4358
               png_crc_finish(png_ptr, bytes_to_skip);
4364
                  png_error(png_ptr, "Not enough image data");
4359
               bytes_to_skip = 0;
4365
            }
4360
4366
            else
4361
               png_ptr->idat_size = png_read_chunk_header(png_ptr);
4367
            {
4362
               if (png_ptr->num_frames_read == 0)
4368
               if (png_ptr->chunk_name == png_IEND)
4369
                  png_error(png_ptr, "Not enough image data");
4370
               if (png_ptr->chunk_name != png_fdAT)
4371
               {
4363
               {
4372
                  png_warning(png_ptr, "Skipped (ignored) a chunk "
4364
                  if (png_ptr->chunk_name != png_IDAT)
4373
                                       "between APNG chunks");
4365
                     png_error(png_ptr, "Not enough image data");
4374
                  bytes_to_skip = png_ptr->idat_size;
4375
                  continue;
4376
               }
4366
               }
4367
               else
4368
               {
4369
                  if (png_ptr->chunk_name == png_IEND)
4370
                     png_error(png_ptr, "Not enough image data");
4371
                  if (png_ptr->chunk_name != png_fdAT)
4372
                  {
4373
                     png_warning(png_ptr, "Skipped (ignored) a chunk "
4374
                                          "between APNG chunks");
4375
                     bytes_to_skip = png_ptr->idat_size;
4376
                     continue;
4377
                  }
4377
4378
4378
               png_ensure_sequence_number(png_ptr, png_ptr->idat_size);
4379
                  png_ensure_sequence_number(png_ptr, png_ptr->idat_size);
4379
4380
4380
               png_ptr->idat_size -= 4;
4381
                  png_ptr->idat_size -= 4;
4382
               }
4381
            }
4383
            }
4382
         }
4384
         }
4383
#else
4385
         else
4384
         while (png_ptr->idat_size == 0)
4385
         {
4386
         {
4386
            png_crc_finish(png_ptr, 0);
4387
            while (png_ptr->idat_size == 0)
4388
            {
4389
               png_crc_finish(png_ptr, 0);
4387
4390
4388
            png_ptr->idat_size = png_read_chunk_header(png_ptr);
4391
               png_ptr->idat_size = png_read_chunk_header(png_ptr);
4389
            /* This is an error even in the 'check' case because the code just
4392
               /* This is an error even in the 'check' case because the code just
4390
             * consumed a non-IDAT header.
4393
                * consumed a non-IDAT header.
4391
             */
4394
                */
4392
            if (png_ptr->chunk_name != png_IDAT)
4395
               if (png_ptr->chunk_name != png_IDAT)
4393
               png_error(png_ptr, "Not enough image data");
4396
                  png_error(png_ptr, "Not enough image data");
4397
            }
4394
         }
4398
         }
4395
#endif /* READ_APNG */
4396
4399
4397
         avail_in = png_ptr->IDAT_read_size;
4400
         avail_in = png_ptr->IDAT_read_size;
4398
4401
Lines 4457-4463 Link Here
4457
         png_ptr->mode |= PNG_AFTER_IDAT;
4460
         png_ptr->mode |= PNG_AFTER_IDAT;
4458
         png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
4461
         png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED;
4459
#ifdef PNG_READ_APNG_SUPPORTED
4462
#ifdef PNG_READ_APNG_SUPPORTED
4460
         png_ptr->num_frames_read++;
4463
         if (PNG_APNG_USED)
4464
            png_ptr->num_frames_read++;
4461
#endif
4465
#endif
4462
4466
4463
         if (png_ptr->zstream.avail_in > 0 || png_ptr->idat_size > 0)
4467
         if (png_ptr->zstream.avail_in > 0 || png_ptr->idat_size > 0)
4464
-- pngwrite.c
4468
++ pngwrite.c
Lines 129-135 Link Here
129
       * flag here too.
129
       * flag here too.
130
       */
130
       */
131
#ifdef PNG_WRITE_APNG_SUPPORTED
131
#ifdef PNG_WRITE_APNG_SUPPORTED
132
   if ((info_ptr->valid & PNG_INFO_acTL) != 0)
132
   if (PNG_APNG_USED && (info_ptr->valid & PNG_INFO_acTL) != 0)
133
      png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays);
133
      png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays);
134
#endif
134
#endif
135
#ifdef PNG_GAMMA_SUPPORTED
135
#ifdef PNG_GAMMA_SUPPORTED
Lines 370-376 Link Here
370
      png_error(png_ptr, "No IDATs written into file");
370
      png_error(png_ptr, "No IDATs written into file");
371
371
372
#ifdef PNG_WRITE_APNG_SUPPORTED
372
#ifdef PNG_WRITE_APNG_SUPPORTED
373
   if (png_ptr->num_frames_written != png_ptr->num_frames_to_write)
373
   if (PNG_APNG_USED && png_ptr->num_frames_written != png_ptr->num_frames_to_write)
374
      png_error(png_ptr, "Not enough frames written");
374
      png_error(png_ptr, "Not enough frames written");
375
#endif
375
#endif
376
376
377
-- pngwutil.c
377
++ pngwutil.c
Lines 1010-1016 Link Here
1010
         if (size > 0)
1010
         if (size > 0)
1011
#ifdef PNG_WRITE_APNG_SUPPORTED
1011
#ifdef PNG_WRITE_APNG_SUPPORTED
1012
         {
1012
         {
1013
            if (png_ptr->num_frames_written == 0)
1013
            if (!PNG_APNG_USED || png_ptr->num_frames_written == 0)
1014
#endif
1014
#endif
1015
            png_write_complete_chunk(png_ptr, png_IDAT, data, size);
1015
            png_write_complete_chunk(png_ptr, png_IDAT, data, size);
1016
#ifdef PNG_WRITE_APNG_SUPPORTED
1016
#ifdef PNG_WRITE_APNG_SUPPORTED
Lines 1067-1073 Link Here
1067
         if (size > 0)
1067
         if (size > 0)
1068
#ifdef PNG_WRITE_APNG_SUPPORTED
1068
#ifdef PNG_WRITE_APNG_SUPPORTED
1069
         {
1069
         {
1070
            if (png_ptr->num_frames_written == 0)
1070
            if (!PNG_APNG_USED || png_ptr->num_frames_written == 0)
1071
#endif
1071
#endif
1072
            png_write_complete_chunk(png_ptr, png_IDAT, data, size);
1072
            png_write_complete_chunk(png_ptr, png_IDAT, data, size);
1073
#ifdef PNG_WRITE_APNG_SUPPORTED
1073
#ifdef PNG_WRITE_APNG_SUPPORTED
1074
-- scripts/symbols.def
1074
++ scripts/symbols.def
Lines 273-275 Link Here
273
 png_set_progressive_frame_fn @267
273
 png_set_progressive_frame_fn @267
274
 png_write_frame_head @268
274
 png_write_frame_head @268
275
 png_write_frame_tail @269
275
 png_write_frame_tail @269
276
 png_use_apng @270

Return to bug 824018