Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 662703 Details for
Bug 886719
col_offset not properly handled in TIFFRGBAImageGet
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Gary Cramblitt's patch adapted to 3.9.6-2 from FC17
libtiff-upstream_tiled_and_stripped_image_bugfix.patch (text/plain), 7.75 KB, created by
Charles Stewart
on 2012-12-13 01:12:45 UTC
(
hide
)
Description:
Gary Cramblitt's patch adapted to 3.9.6-2 from FC17
Filename:
MIME Type:
Creator:
Charles Stewart
Created:
2012-12-13 01:12:45 UTC
Size:
7.75 KB
patch
obsolete
>--- C:\scratch\tiff-4.0.2\libtiff\tif_getimage.c 2012-06-05 17:17:50.000000000 -0400 >+++ C:\NPTDEVFILES\Source\Libs\MAPIMPORTLIB\tiff-4.0.2\libtiff\tif_getimage.c 2012-08-30 14:32:42.000000000 -0400 >@@ -594,12 +594,16 @@ > tmsize_t pos; > uint32 tw, th; > unsigned char* buf; > int32 fromskew, toskew; > uint32 nrow; > int ret = 1, flip; >+ uint32 this_tw, tocol; >+ int32 this_toskew, leftmost_toskew; >+ int32 leftmost_fromskew; >+ uint32 leftmost_tw; > > buf = (unsigned char*) _TIFFmalloc(TIFFTileSize(tif)); > if (buf == 0) { > TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "%s", "No space for tile buffer"); > return (0); > } >@@ -614,43 +618,56 @@ > } > else { > y = 0; > toskew = -(int32)(tw - w); > } > >+ /* >+ * Leftmost tile is clipped on left side if col_offset > 0. >+ */ >+ leftmost_fromskew = img->col_offset % tw; >+ leftmost_tw = tw - leftmost_fromskew; >+ leftmost_toskew = toskew + leftmost_fromskew; > for (row = 0; row < h; row += nrow) > { > rowstoread = th - (row + img->row_offset) % th; > nrow = (row + rowstoread > h ? h - row : rowstoread); >- for (col = 0; col < w; col += tw) >+ fromskew = leftmost_fromskew; >+ this_tw = leftmost_tw; >+ this_toskew = leftmost_toskew; >+ tocol = 0; >+ col = img->col_offset; >+ while (tocol < w) > { >- if (TIFFReadTile(tif, buf, col+img->col_offset, >+ if (TIFFReadTile(tif, buf, col, > row+img->row_offset, 0, 0)==(tmsize_t)(-1) && img->stoponerr) > { > ret = 0; > break; > } >- >- pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif); >- >- if (col + tw > w) >- { >- /* >- * Tile is clipped horizontally. Calculate >- * visible portion and skewing factors. >- */ >- uint32 npix = w - col; >- fromskew = tw - npix; >- (*put)(img, raster+y*w+col, col, y, >- npix, nrow, fromskew, toskew + fromskew, buf + pos); >- } >- else >- { >- (*put)(img, raster+y*w+col, col, y, tw, nrow, 0, toskew, buf + pos); >- } >- } >+ pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif) + \ >+ (fromskew * img->samplesperpixel); >+ if (tocol + this_tw > w) >+ { >+ /* >+ * Rightmost tile is clipped on right side. >+ */ >+ fromskew = tw - (w - tocol); >+ this_tw = tw - fromskew; >+ this_toskew = toskew + fromskew; >+ } >+ (*put)(img, raster+y*w+tocol, tocol, y, this_tw, nrow, fromskew, this_toskew, buf + pos); >+ tocol += this_tw; >+ col += this_tw; >+ /* >+ * After the leftmost tile, tiles are no longer clipped on left side. >+ */ >+ fromskew = 0; >+ this_tw = tw; >+ this_toskew = toskew; >+ } > > y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); > } > _TIFFfree(buf); > > if (flip & FLIP_HORIZONTALLY) { >@@ -695,12 +712,16 @@ > tmsize_t bufsize; > int32 fromskew, toskew; > int alpha = img->alpha; > uint32 nrow; > int ret = 1, flip; > int colorchannels; >+ uint32 this_tw, tocol; >+ int32 this_toskew, leftmost_toskew; >+ int32 leftmost_fromskew; >+ uint32 leftmost_tw; > > tilesize = TIFFTileSize(tif); > bufsize = TIFFSafeMultiply(tmsize_t,alpha?4:3,tilesize); > if (bufsize == 0) { > TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Integer overflow in %s", "gtTileSeparate"); > return (0); >@@ -739,66 +760,81 @@ > > default: > colorchannels = 3; > break; > } > >+ /* >+ * Leftmost tile is clipped on left side if col_offset > 0. >+ */ >+ leftmost_fromskew = img->col_offset % tw; >+ leftmost_tw = tw - leftmost_fromskew; >+ leftmost_toskew = toskew + leftmost_fromskew; > for (row = 0; row < h; row += nrow) > { > rowstoread = th - (row + img->row_offset) % th; > nrow = (row + rowstoread > h ? h - row : rowstoread); >- for (col = 0; col < w; col += tw) >+ fromskew = leftmost_fromskew; >+ this_tw = leftmost_tw; >+ this_toskew = leftmost_toskew; >+ tocol = 0; >+ col = img->col_offset; >+ while (tocol < w) > { >- if (TIFFReadTile(tif, p0, col+img->col_offset, >+ if (TIFFReadTile(tif, p0, col, > row+img->row_offset,0,0)==(tmsize_t)(-1) && img->stoponerr) > { > ret = 0; > break; > } > if (colorchannels > 1 >- && TIFFReadTile(tif, p1, col+img->col_offset, >+ && TIFFReadTile(tif, p1, col, > row+img->row_offset,0,1) == (tmsize_t)(-1) > && img->stoponerr) > { > ret = 0; > break; > } > if (colorchannels > 1 >- && TIFFReadTile(tif, p2, col+img->col_offset, >+ && TIFFReadTile(tif, p2, col, > row+img->row_offset,0,2) == (tmsize_t)(-1) > && img->stoponerr) > { > ret = 0; > break; > } > if (alpha >- && TIFFReadTile(tif,pa,col+img->col_offset, >+ && TIFFReadTile(tif,pa,col, > row+img->row_offset,0,colorchannels) == (tmsize_t)(-1) > && img->stoponerr) > { > ret = 0; > break; > } > >- pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif); >- >- if (col + tw > w) >+ pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif) + \ >+ (fromskew * img->samplesperpixel); >+ if (tocol + this_tw > w) > { > /* >- * Tile is clipped horizontally. Calculate >- * visible portion and skewing factors. >+ * Rightmost tile is clipped on right side. > */ >- uint32 npix = w - col; >- fromskew = tw - npix; >- (*put)(img, raster+y*w+col, col, y, >- npix, nrow, fromskew, toskew + fromskew, >- p0 + pos, p1 + pos, p2 + pos, (alpha?(pa+pos):NULL)); >- } else { >- (*put)(img, raster+y*w+col, col, y, >- tw, nrow, 0, toskew, p0 + pos, p1 + pos, p2 + pos, (alpha?(pa+pos):NULL)); >- } >+ fromskew = tw - (w - tocol); >+ this_tw = tw - fromskew; >+ this_toskew = toskew + fromskew; >+ } >+ (*put)(img, raster+y*w+tocol, tocol, y, this_tw, nrow, fromskew, this_toskew, \ >+ p0 + pos, p1 + pos, p2 + pos, (alpha?(pa+pos):NULL)); >+ tocol += this_tw; >+ col += this_tw; >+ /* >+ * After the leftmost tile, tiles are no longer clipped on left side. >+ */ >+ fromskew = 0; >+ this_tw = tw; >+ this_toskew = toskew; > } > > y += (flip & FLIP_VERTICALLY ?-(int32) nrow : (int32) nrow); > } > > if (flip & FLIP_HORIZONTALLY) { >@@ -876,13 +912,14 @@ > && img->stoponerr) > { > ret = 0; > break; > } > >- pos = ((row + img->row_offset) % rowsperstrip) * scanline; >+ pos = ((row + img->row_offset) % rowsperstrip) * scanline + \ >+ (img->col_offset * img->samplesperpixel); > (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, buf + pos); > y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); > } > > if (flip & FLIP_HORIZONTALLY) { > uint32 line; >@@ -1007,13 +1044,14 @@ > { > ret = 0; > break; > } > } > >- pos = ((row + img->row_offset) % rowsperstrip) * scanline; >+ pos = ((row + img->row_offset) % rowsperstrip) * scanline + \ >+ (img->col_offset * img->samplesperpixel); > (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, p0 + pos, p1 + pos, > p2 + pos, (alpha?(pa+pos):NULL)); > y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); > } > > if (flip & FLIP_HORIZONTALLY) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 886719
: 662703