From 5670c00eee5ea3096e5fa79c17d81538914fff77 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 4 Jun 2013 10:39:53 +0100 Subject: Fix nasty crash when cropping YUV. --- src/lib/image.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/image.cc') diff --git a/src/lib/image.cc b/src/lib/image.cc index f0a38f4e9..bba7d6be5 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -211,8 +211,8 @@ Image::crop (Crop crop, bool aligned) const /* Start of the source line, cropped from the top but not the left */ uint8_t* in_p = data()[c] + crop.top * stride()[c]; uint8_t* out_p = out->data()[c]; - - for (int y = 0; y < cropped_size.height; ++y) { + + for (int y = 0; y < out->lines(c); ++y) { memcpy (out_p, in_p + crop_left_in_bytes, cropped_width_in_bytes); in_p += stride()[c]; out_p += out->stride()[c]; -- cgit v1.2.3