Closed 0xC0000054 closed 2 years ago
Thanks for reporting.
A workaround is to define cimg_max_buf_size
to a lower value for 32bits architectures with -Dcimg_max_buf_size
.
Having it auto-detected in CImg.h would be better though.
Maybe this https://github.com/dtschump/CImg/commit/d8bb494d6cf829d6b9c73d61a24cbba6075d50ea could solve the problem ?
That would still overflow, 0xffffffff is (4*1024*1024*1024) - 1
.
I would define it as either 3*1024*1024*1024
or 2*1024*1024*1024
.
I will update my build scripts to define cimg_max_buf_size
as 3*1024*1024*1024
.
On Windows the user mode code is limited to 2GB of address space, so you will run out of memory before hitting that limit.
Yes, I've noticed that afterwards :) https://github.com/dtschump/CImg/commit/21ba6b4dbeb74bda1bdd2a5b0983e4337cb897d3
Looks good. Closing this issue.
cimg_max_buf_size
is unconditionally defined as16*1024*1024*1024
, this will overflow the range of acimg_ulong
on Windows x86. On Windows x86cimg_ulong
is defined as anunsigned int
, with a a maximum value of 0xffffffff (4 GB - 1).The
cimg_max_buf_size
value wraps around to 0, which causes G'MIC-Qt to crash with an unhanded exception thrown fromsafe_size
.According to a report I received on the Paint.NET forum, this issue has been occurring with the 32-bit G'MIC-Qt builds since version 3.1.0.