ART crashes with some images when running function "RawImageSource::getAutoMatchedToneCurve"
app crashes with some images when running function "RawImageSource::getAutoMatchedToneCurve" (histmatching.cc file).
....
CurveEvaluator eval(*source, *target);
size_t best = candidates.size();
double bestscore = RT_INFINITY;
for (size_t i = 0; i < candidates.size(); ++i) {
double score = eval(candidates[i]); // --> crash
...
After searching, the following lines produce the crash
int l = c.getVal(img_[y][x]) * 255.f;
++hist[l]; // --> l > 255 To avoid the crash,
I added this modification:
if (l < 256) ++hist[l];
But, this is not a good solution, the best would be for c.getVal(...) to return a value between 0 and 1.
Congratulations again for your fantastic work
Comments (5)
-
repo owner -
reporter This is a OM--1 raw image that i found on the web.
I use LibRaw (https://github.com/LibRaw/LibRaw)..)
With “mem_image” software sample, the extraction is Ok
-
repo owner I’m not sure the OM-1 is fully supported yet, it only comes in a unreleased version of libraw (not even the latest snapshot). Do you have another example where this crashes?
Note: this is most definitely a bug, but I’d like to understand a bit better when it happens…
-
reporter WeTransfer link: https://we.tl/t-M7PEvJ5bPt
-
repo owner - changed status to resolved
- Log in to comment
hi,
Thanks for reporting. Do you have an image you can share that triggers the bug?