summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-06-04 10:39:53 +0100
committerCarl Hetherington <cth@carlh.net>2013-06-04 10:39:53 +0100
commit5670c00eee5ea3096e5fa79c17d81538914fff77 (patch)
treeb1e732c43bef7548aae387e8533f48286addc185 /src/lib
parente110d927e8dfec709a548172173b3ed1236c2d82 (diff)
Fix nasty crash when cropping YUV.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/image.cc4
1 files changed, 2 insertions, 2 deletions
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];