diff options
author | faxguy <faxguy> | 2010-12-15 00:22:05 +0000 |
---|---|---|
committer | faxguy <faxguy> | 2010-12-15 00:22:05 +0000 |
commit | 7c1391f17410802d31dd1c99a8f3bdbde8e6e8d8 (patch) | |
tree | 3461df83b4a48e3c9fa528574ae904c2d84cde65 | |
parent | 800e064b5e523c9e2438d85d30862d2cd4b6d25b (diff) | |
download | libtiff-7c1391f17410802d31dd1c99a8f3bdbde8e6e8d8.tar.gz |
* tools/gif2tiff.c: fix buffer overrun
http://bugzilla.maptools.org/show_bug.cgi?id=2270
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tools/gif2tiff.c | 6 |
2 files changed, 11 insertions, 2 deletions
@@ -1,4 +1,9 @@ -2010-12-13 Lee Howard <faxguy@howardsilvan.com> +2010-12-14 Lee Howard <faxguy@howardsilvan.com> + + * tools/gif2tiff.c: fix buffer overrun + http://bugzilla.maptools.org/show_bug.cgi?id=2270 + +2010-12-14 Lee Howard <faxguy@howardsilvan.com> * libtiff/tif_jpeg.c: reduce usage of JCS_UNKNOWN in order to improve compatibility with various viewers diff --git a/tools/gif2tiff.c b/tools/gif2tiff.c index 9c2cfa4d..6035a794 100644 --- a/tools/gif2tiff.c +++ b/tools/gif2tiff.c @@ -1,4 +1,4 @@ -/* $Id: gif2tiff.c,v 1.8.2.1 2010-06-08 18:50:44 bfriesen Exp $ */ +/* $Id: gif2tiff.c,v 1.8.2.2 2010-12-15 00:22:05 faxguy Exp $ */ /* * Copyright (c) 1990-1997 Sam Leffler @@ -503,6 +503,10 @@ rasterize(int interleaved, char* mode) strip = 0; stripsize = TIFFStripSize(tif); for (row=0; row<height; row += rowsperstrip) { + if (rowsperstrip > height-row) { + rowsperstrip = height-row; + stripsize = TIFFVStripSize(tif, rowsperstrip); + } if (TIFFWriteEncodedStrip(tif, strip, newras+row*width, stripsize) < 0) break; strip++; |