fix: Prevent integer overflow in rowbytes computation

Cast `row_width` to `size_t` before multiplication when computing
`row_info->rowbytes`, to avoid 32-bit truncation on LP64 systems.

Fix the cast order in `png_do_expand_palette` where the widening
cast was applied after the multiply rather than before it.

This is a cherry-pick of commit c0ba09ecb44f0962b6532747b09e2f8160e29baf
from branch 'libpng18'.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2 files changed