Skip to content

size apng frame buffer from png bit depth, not sBIT#238

Open
rootvector2 wants to merge 1 commit into
google:mainfrom
rootvector2:apng-sbit-rowsize
Open

size apng frame buffer from png bit depth, not sBIT#238
rootvector2 wants to merge 1 commit into
google:mainfrom
rootvector2:apng-sbit-rowsize

Conversation

@rootvector2

Copy link
Copy Markdown
Contributor

Noticed the APNG decoder picks UINT8 vs UINT16 storage (and bytes_per_pixel, which sizes the frameRaw rows handed to png_progressive_combine_row) from ppf->info.bits_per_sample. SetColorData lowers that to the sBIT significant-bit count, so a 16-bit PNG carrying an sBIT of 8 ends up with 1-byte samples while libpng, with no png_set_scale_16/strip_16 applied, still writes 2-byte samples, overflowing each row by one byte per sample. Pick the depth from the actual png bit depth instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant