Commit e3908397 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

windowscodecs: Fix the tile coordinate translation in the TIFF decoder.

parent 39ea772a
......@@ -756,16 +756,20 @@ static HRESULT WINAPI TiffFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface,
if (prc->X+prc->Width > (tile_x+1) * This->decode_info.tile_width)
rc.Width = This->decode_info.tile_width - rc.X;
else if (prc->X < tile_x * This->decode_info.tile_width)
rc.Width = prc->Width + prc->X - tile_x * This->decode_info.tile_width;
else
rc.Width = prc->Width + rc.X - prc->X;
rc.Width = prc->Width;
if (prc->Y+prc->Height > (tile_y+1) * This->decode_info.tile_height)
rc.Height = This->decode_info.tile_height - rc.Y;
else if (prc->Y < tile_y * This->decode_info.tile_height)
rc.Height = prc->Height + prc->Y - tile_y * This->decode_info.tile_height;
else
rc.Height = prc->Height + rc.Y - prc->Y;
rc.Height = prc->Height;
dst_tilepos = pbBuffer + (cbStride * (rc.Y - prc->Y)) +
((This->decode_info.bpp * (rc.X - prc->X) + 7) / 8);
dst_tilepos = pbBuffer + (cbStride * ((rc.Y + tile_y * This->decode_info.tile_height) - prc->Y)) +
((This->decode_info.bpp * ((rc.X + tile_x * This->decode_info.tile_width) - prc->X) + 7) / 8);
hr = copy_pixels(This->decode_info.bpp, This->cached_tile,
This->decode_info.tile_width, This->decode_info.tile_height, This->decode_info.tile_stride,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment