}
w_sub = 0;
if (out_finfo->n_planes == 1) {
- /* for packet formats, convert based on subsampling so that we
+ /* for packed formats, convert based on subsampling so that we
* get a complete group of pixels */
for (i = 0; i < out_finfo->n_components; i++) {
w_sub = MAX (w_sub, out_finfo->w_sub[i]);
}
} else {
guint vx, vw;
+ guint h_taps;
- vx = hscale->resampler.offset[x];
- vw = hscale->resampler.offset[x + width - 1] +
- hscale->resampler.max_taps;
+ h_taps = hscale->resampler.max_taps;
+
+ vx = (hscale->inc * x) >> 16;
+ vx = MIN (vx, hscale->resampler.offset[x]);
+ vw = (hscale->inc * (x + width)) >> 16;
+ vw = MAX (vw, hscale->resampler.offset[x + width - 1] + h_taps);
+ vw += 1;
if (vscale->tmpwidth < vw)
realloc_tmplines (vscale, n_elems, vw);