summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorerouault <erouault>2016-12-20 17:13:26 +0000
committererouault <erouault>2016-12-20 17:13:26 +0000
commit5cf63fa6b801665fe8666c1cfac0288970071086 (patch)
tree6f4c1f85f4def8b96cad7531c45649b06d81d8a6 /tools
parentf06644c2cc76dc5791f81a419d71e1b1adf1abfd (diff)
downloadlibtiff-5cf63fa6b801665fe8666c1cfac0288970071086.tar.gz
* tools/tiff2pdf.c: fix wrong usage of memcpy() that can trigger
unspecified behaviour. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2638
Diffstat (limited to 'tools')
-rw-r--r--tools/tiff2pdf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
index afea414b..78ffa77d 100644
--- a/tools/tiff2pdf.c
+++ b/tools/tiff2pdf.c
@@ -1,4 +1,4 @@
-/* $Id: tiff2pdf.c,v 1.98 2016-12-18 10:37:59 erouault Exp $
+/* $Id: tiff2pdf.c,v 1.99 2016-12-20 17:13:26 erouault Exp $
*
* tiff2pdf - converts a TIFF image to a PDF document
*
@@ -3593,7 +3593,8 @@ void t2p_tile_collapse_left(
edgescanwidth = (scanwidth * edgetilewidth + (tilewidth - 1))/ tilewidth;
for(i=0;i<tilelength;i++){
- _TIFFmemcpy(
+ /* We use memmove() since there can be overlaps in src and dst buffers for the first items */
+ memmove(
&(((char*)buffer)[edgescanwidth*i]),
&(((char*)buffer)[scanwidth*i]),
edgescanwidth);