Skip to content

Commit

Permalink
Fix bug with APNG frames with less than full height
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaaaa123456789 committed Jan 19, 2022
1 parent 7de1440 commit ae04c28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pngread.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void load_PNG_data (struct context * context, unsigned flags, size_t limit) {
uint_fast32_t top = read_be32_unaligned(context -> data + *frameinfo + 16);
if ((width | height | left | top) & 0x80000000u) throw(context, PLUM_ERR_INVALID_FILE_FORMAT);
if (((width + left) > context -> image -> width) || ((height + top) > context -> image -> height)) throw(context, PLUM_ERR_INVALID_FILE_FORMAT);
if ((width == context -> image -> width) && (height = context -> image -> height))
if ((width == context -> image -> width) && (height == context -> image -> height))
load_PNG_frame(context, *framedata, frame, palette, max_palette_index, imagetype, bitdepth, interlaced, background, transparent);
else {
uint64_t * output = ctxmalloc(context, sizeof *output * context -> image -> width * context -> image -> height);
Expand Down

0 comments on commit ae04c28

Please sign in to comment.