Fixing build on gcc/clang
This commit is contained in:
parent
03dee86071
commit
7b52dc2324
1 changed files with 9 additions and 7 deletions
|
@ -149,6 +149,7 @@ static bool write_rgb_or_gray_to_file(const char *file_name_utf8, size_t width,
|
||||||
|
|
||||||
// Initialize rows of PNG.
|
// Initialize rows of PNG.
|
||||||
row_pointers = reinterpret_cast<png_byte**>(::png_malloc(png_ptr, height * sizeof(png_byte*)));
|
row_pointers = reinterpret_cast<png_byte**>(::png_malloc(png_ptr, height * sizeof(png_byte*)));
|
||||||
|
{
|
||||||
int line_width = width;
|
int line_width = width;
|
||||||
if (png_color_type == PNG_COLOR_TYPE_RGB)
|
if (png_color_type == PNG_COLOR_TYPE_RGB)
|
||||||
line_width *= 3;
|
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;
|
row_pointers[y] = row;
|
||||||
memcpy(row, data + line_width * y, line_width);
|
memcpy(row, data + line_width * y, line_width);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Write the image data to "fp".
|
// Write the image data to "fp".
|
||||||
png_init_io(png_ptr, fp);
|
png_init_io(png_ptr, fp);
|
||||||
|
|
Loading…
Add table
Reference in a new issue