From 52cc52437e0eb448fa3a56f765d9bb90fa8c90bc Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Wed, 2 Jun 2021 04:37:55 +0200 Subject: [PATCH] process_pipeline: Set the thumbnail row buffer to correct size Otherwise it's saving 2*image->width bytes of uninitialized memory image->height times into the DNG file. --- src/process_pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/process_pipeline.c b/src/process_pipeline.c index dd5e4f4..830d2ad 100644 --- a/src/process_pipeline.c +++ b/src/process_pipeline.c @@ -401,7 +401,7 @@ process_image_for_capture(const uint8_t *image, int count) // Write black thumbnail, only windows uses this { unsigned char *buf = - (unsigned char *)calloc(1, (int)mode.width >> 4); + (unsigned char *)calloc(1, (mode.width >> 4) * 3); for (int row = 0; row < (mode.height >> 4); row++) { TIFFWriteScanline(tif, buf, row, 0); }