We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0388dfa commit c7c3285Copy full SHA for c7c3285
src/gfx/process.cpp
@@ -226,8 +226,8 @@ class Png {
226
if (options.inputSlice.height == 0 && height % 8 != 0) {
227
fatal("Image height (%" PRIu32 " pixels) is not a multiple of 8!", height);
228
}
229
- if (options.inputSlice.left + options.inputSlice.width * 8 > width
230
- || options.inputSlice.top + options.inputSlice.height * 8 > height) {
+ if (options.inputSlice.width * 8 > width - options.inputSlice.left
+ || options.inputSlice.height * 8 > height - options.inputSlice.top) {
231
error(
232
"Image slice ((%" PRIu32 ", %" PRIu32 ") to (%" PRId32 ", %" PRId32
233
")) is outside the image bounds (%" PRIu32 "x%" PRIu32 ")!",
0 commit comments