Skip to content

Commit

Permalink
Fix crash when opening multi-frame images
Browse files Browse the repository at this point in the history
Fix source of raw data when calculating raw minimum values for raw
de-haze.
  • Loading branch information
Lawrence37 committed Nov 24, 2024
1 parent 3e8d581 commit 2a6b79f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions rtengine/rawimagesource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2690,9 +2690,9 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, con
*/

if (ri->getSensorType() == ST_BAYER) {
getMinValsBayer(ri->zeroIsBad());
getMinValsBayer(rawData, ri->zeroIsBad());
} else {
getMinValsXtrans();
getMinValsXtrans(rawData);
}
//
reddeha = minVals[0];
Expand Down Expand Up @@ -8384,7 +8384,7 @@ void RawImageSource::getRawValues(int x, int y, int rotate, int &R, int &G, int
/*
Copyright (c) Ingo Weyrich 2020 (heckflosse67@gmx.de)
*/
void RawImageSource::getMinValsXtrans() {
void RawImageSource::getMinValsXtrans(const array2D<float> &rawData) {
#ifdef _OPENMP
#pragma omp parallel for reduction (min:minVals)
#endif
Expand Down Expand Up @@ -8530,7 +8530,7 @@ void RawImageSource::applyDngGainMap(const float black[4], const std::vector<Gai
/*
Copyright (c) Ingo Weyrich 2020 (heckflosse67@gmx.de)
*/
void RawImageSource::getMinValsBayer(bool zeroIsBad) {
void RawImageSource::getMinValsBayer(const array2D<float> &rawData, bool zeroIsBad) {
BENCHFUN
if (!zeroIsBad) {
#ifdef _OPENMP
Expand Down
4 changes: 2 additions & 2 deletions rtengine/rawimagesource.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ class RawImageSource final : public ImageSource
void vflip (Imagefloat* im);
void getRawValues(int x, int y, int rotate, int &R, int &G, int &B) override;
void captureSharpening(const procparams::CaptureSharpeningParams &sharpeningParams, bool showMask, double &conrastThreshold, double &radius) override;
void getMinValsXtrans();
void getMinValsBayer(bool zeroIsBad);
void getMinValsXtrans(const array2D<float> &rawData);
void getMinValsBayer(const array2D<float> &rawData, bool zeroIsBad);
void applyDngGainMap(const float black[4], const std::vector<GainMap> &gainMaps);
public:
void wbMul2Camera(double &rm, double &gm, double &bm) override;
Expand Down

0 comments on commit 2a6b79f

Please sign in to comment.