Fixing build on gcc/clang

This commit is contained in:
Vojtech Bubnik 2021-02-22 19:43:04 +01:00
parent 03dee86071
commit 7b52dc2324

View file

@ -149,6 +149,7 @@ static bool write_rgb_or_gray_to_file(const char *file_name_utf8, size_t width,
// Initialize rows of PNG.
row_pointers = reinterpret_cast<png_byte**>(::png_malloc(png_ptr, height * sizeof(png_byte*)));
{
int line_width = width;
if (png_color_type == PNG_COLOR_TYPE_RGB)
line_width *= 3;
@ -157,6 +158,7 @@ static bool write_rgb_or_gray_to_file(const char *file_name_utf8, size_t width,
row_pointers[y] = row;
memcpy(row, data + line_width * y, line_width);
}
}
// Write the image data to "fp".
png_init_io(png_ptr, fp);