Skip to content

Commit

Permalink
Fix dt_imageio_export_with_flags if there is no pipe.backbuf
Browse files Browse the repository at this point in the history
A NULL pointer as pipe.backbuf can result from a very large upscaling attempt with impossible
allocation. In this case abort writing the file.
  • Loading branch information
jenshannoschwalm authored and TurboGit committed Jan 15, 2022
1 parent d20c1df commit 13ef59f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/common/imageio.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,11 @@ int dt_imageio_export_with_flags(const int32_t imgid, const char *filename,
: "[dev_process_export] pixel pipeline processing");

uint8_t *outbuf = pipe.backbuf;
if(outbuf == NULL)
{
dt_print(DT_DEBUG_IMAGEIO, "[dt_imageio_export_with_flags] no valid output buffer\n");
goto error;
}

// downconversion to low-precision formats:
if(bpp == 8)
Expand Down

0 comments on commit 13ef59f

Please sign in to comment.