ext/oily_png/resampling.c in oily_png-1.1.1 vs ext/oily_png/resampling.c in oily_png-1.1.2

- old
+ new

@@ -176,15 +176,15 @@ PIXEL y_residue, x_residue; PIXEL pixel_11, pixel_21, pixel_12, pixel_22; PIXEL pixel_top, pixel_bot; for (y = 0; y < new_height; y++) { y1 = index_y[y] < 0 ? 0 : index_y[y]; - y2 = y1+1 >= self_height ? self_height-1 : y1+1; + y2 = index_y[y]+1 >= self_height ? self_height-1 : index_y[y]+1; y_residue = interp_y[y]; for (x = 0; x < new_width; x++) { x1 = index_x[x] < 0 ? 0 : index_x[x]; - x2 = x1+1 >= self_width ? self_height-1 : x1+1; + x2 = index_x[x]+1 >= self_width ? self_width-1 : index_x[x]+1; x_residue = interp_x[x]; pixel_11 = NUM2UINT(rb_ary_entry(source, y1*self_width + x1)); pixel_21 = NUM2UINT(rb_ary_entry(source, y1*self_width + x2)); pixel_12 = NUM2UINT(rb_ary_entry(source, y2*self_width + x1));