summaryrefslogtreecommitdiff
path: root/test/test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-11-04 16:38:14 +0100
committerCarl Hetherington <cth@carlh.net>2019-11-16 22:46:39 +0100
commited4fc06db6957b2b63b2400a737f47c18a1003be (patch)
treee429ffc3df79e141dacb870ffe9d232e8b72efd4 /test/test.cc
parent81e40e7b915a55f8e5aa2db34ad809552b1534e3 (diff)
Fix incorrect images when cropping without stretch.
Always overallocate images so that Image::crop_scale_window is always safe from over-reading buffers. Relates to #1654 and probably #1653. Backported from 7b0372776ac4da6a8e4ff29f41a4f08b9b4de506 in v2.15.x.
Diffstat (limited to 'test/test.cc')
-rw-r--r--test/test.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test.cc b/test/test.cc
index 50770a687..a9d3ed1c7 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -417,11 +417,11 @@ wait_for_jobs ()
}
void
-write_image (shared_ptr<const Image> image, boost::filesystem::path file, string format)
+write_image (shared_ptr<const Image> image, boost::filesystem::path file, string format, MagickCore::StorageType pixel_type)
{
using namespace MagickCore;
- Magick::Image m (image->size().width, image->size().height, format.c_str(), CharPixel, (void *) image->data()[0]);
+ Magick::Image m (image->size().width, image->size().height, format.c_str(), pixel_type, (void *) image->data()[0]);
m.write (file.string ());
}