summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-03-29 06:07:50 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-03-29 06:07:50 +0000
commit5b33228f8cfa003d9c03216c65a06db656396bc3 (patch)
treec2f46d79a2efacf7a780b4f29e7ae4a1d1b04521 /Build
parenteef301be9183c24e6319de3302ef4ae1d31026bc (diff)
pdftexdir/writepng.c: Fix the size of memory to allocate when writing SMask in write_png_rgb_alpha (from David Fifield)
git-svn-id: svn://tug.org/texlive/trunk@43637 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog6
-rw-r--r--Build/source/texk/web2c/pdftexdir/writepng.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index d6eb35ac852..92dc192dfcb 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,9 @@
+2017-03-29 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * writepng.c: Fix the size of memory to allocate when writing
+ SMask in write_png_rgb_alpha. Reported by David Fifield:
+ http://tug.org/pipermail/pdftex/2017-March/009100.html.
+
2017-03-18 Karl Berry <karl@tug.org>
* NEWS,
diff --git a/Build/source/texk/web2c/pdftexdir/writepng.c b/Build/source/texk/web2c/pdftexdir/writepng.c
index 5713880f6e1..56d398f1c2d 100644
--- a/Build/source/texk/web2c/pdftexdir/writepng.c
+++ b/Build/source/texk/web2c/pdftexdir/writepng.c
@@ -335,7 +335,7 @@ static void write_png_rgb_alpha(integer img)
pdfcreateobj(0, 0);
smask_objnum = objptr;
pdf_printf("/SMask %i 0 R\n", (int) smask_objnum);
- smask_size = (png_get_rowbytes(png_ptr(img), png_info(img)) / 2)
+ smask_size = (png_get_rowbytes(png_ptr(img), png_info(img)) / 4)
* png_get_image_height(png_ptr(img), png_info(img));
smask = xtalloc(smask_size, png_byte);
pdfbeginstream();