diff --git a/src/tiff_reader.cpp b/src/tiff_reader.cpp index f400cc0ee..37f8367c2 100644 --- a/src/tiff_reader.cpp +++ b/src/tiff_reader.cpp @@ -650,6 +650,7 @@ void tiff_reader::read_stripped(unsigned x0,unsigned y0,image_data_rgba8& ima unsigned start_y=(y0/rows_per_strip_)*rows_per_strip_; unsigned end_y=((y0+height)/rows_per_strip_+1)*rows_per_strip_; + std::min(end_y, (unsigned)height_); bool laststrip=(static_cast(end_y) > height_)?true:false; int row,tx0,tx1,ty0,ty1;