From 74984f10498c5a54e0de58393b245e63c8f1ec9d Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 19 Mar 2016 10:37:02 +0000 Subject: [PATCH] off by one error didn't always write the output --- libvips/iofuncs/vector.c | 2 +- libvips/resample/reducev.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libvips/iofuncs/vector.c b/libvips/iofuncs/vector.c index 922feb32..a1fb50c9 100644 --- a/libvips/iofuncs/vector.c +++ b/libvips/iofuncs/vector.c @@ -48,8 +48,8 @@ */ /* Trace all orc calls, handy for debugging. -#define DEBUG_TRACE */ +#define DEBUG_TRACE #ifdef HAVE_CONFIG_H #include diff --git a/libvips/resample/reducev.cpp b/libvips/resample/reducev.cpp index 52c0faf1..1d823e45 100644 --- a/libvips/resample/reducev.cpp +++ b/libvips/resample/reducev.cpp @@ -34,8 +34,8 @@ */ /* -#define DEBUG */ +#define DEBUG #ifdef HAVE_CONFIG_H #include @@ -229,7 +229,7 @@ vips_reducev_compile_section( VipsReducev *reducev, Pass *pass, gboolean first ) /* If this is the end of the mask, we write the 8-bit result to the * image, otherwise write the 16-bit intermediate to our temp buffer. */ - if( i == reducev->n_point ) { + if( i >= reducev->n_point - 1 ) { ASM3( "shrsw", "sum", "sum", seven ); ASM3( "maxsw", "sum", zero, "sum" ); ASM2( "convwb", "d1", "sum" );