Skip to content

Commit

Permalink
check dt_interpolation_resample for available output
Browse files Browse the repository at this point in the history
due to very strong upscaling we might silently get a NULL pointer as out because a buffer
could not be allocated. In this case the resampling code will fail so we do an early return
for safety.
  • Loading branch information
jenshannoschwalm authored and TurboGit committed Jan 15, 2022
1 parent 66aafd9 commit d20c1df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/common/interpolation.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,12 @@ void dt_interpolation_resample(const struct dt_interpolation *itor, float *out,
const float *const in, const dt_iop_roi_t *const roi_in,
const int32_t in_stride)
{
if(out == NULL)
{
dt_print(DT_DEBUG_MEMORY, "[dt_interpolation_resample] no valid output buffer\n");
return;
}

if(darktable.codepath.OPENMP_SIMD)
return dt_interpolation_resample_plain(itor, out, roi_out, out_stride, in, roi_in, in_stride);
#if defined(__SSE2__)
Expand Down

0 comments on commit d20c1df

Please sign in to comment.