plug-ins: fix #12500 End of file error loading PSD file

The block size for layer info should be a multiple of 2.

We had erroneously thought it was a multiple of 4, based on what is used
for layer resources. But of course Photoshop is inconsistent and uses
a multiple of 2 here.
This commit is contained in:
Simon Munton 2024-12-02 12:23:28 -05:00 committed by Jacob Boerema
parent 91203b76cb
commit d1e20e5e31
1 changed files with 2 additions and 2 deletions

View File

@ -1374,8 +1374,8 @@ read_layer_block (PSDimage *img_a,
/* To make computations easier add the size of block_len */
block_len += block_len_size;
/* Actual block size is a multiple of 4 */
adjusted_block_len = (block_len + 3) / 4 * 4;
/* Actual block size is a multiple of 2 */
adjusted_block_len = (block_len + 1) / 2 * 2;
if (block_len > block_len_size)
{