diff options
Diffstat (limited to 'src/resources/imagewriter.cpp')
-rw-r--r-- | src/resources/imagewriter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/resources/imagewriter.cpp b/src/resources/imagewriter.cpp index 65e3a7dbe..9ff87c758 100644 --- a/src/resources/imagewriter.cpp +++ b/src/resources/imagewriter.cpp @@ -84,7 +84,8 @@ bool ImageWriter::writePNG(SDL_Surface *const surface, png_set_packing(png_ptr); - png_bytep *const row_pointers = new png_bytep[surface->h]; + png_bytep *const row_pointers + = new png_bytep[static_cast<size_t>(surface->h)]; /* if (!row_pointers) { @@ -97,7 +98,7 @@ bool ImageWriter::writePNG(SDL_Surface *const surface, for (int i = 0; i < surface->h; i++) { row_pointers[i] = static_cast<png_bytep>(static_cast<uint8_t *>( - surface->pixels)) + i * surface->pitch; + surface->pixels) + static_cast<size_t>(i * surface->pitch)); } png_write_image(png_ptr, row_pointers); |