[gs-cvs] gs/src
Igor Melichev
igor at ghostscript.com
Tue Jun 7 09:41:26 PDT 2005
Update of /cvs/ghostscript/gs/src
In directory casper2:/tmp/cvs-serv6539/gs/src
Modified Files:
gdevpdf.c gdevpdfx.h
Log Message:
Fix (pdfwrite) : The memory descriptor of gx_device_pdf missed some strings.
DETAILS :
The bug was introduced when implementing the PDF encryption.
Minor change : the string data change the type from gs_const_string to gs_string
to comply with memory management macros.
EXPECTED DIFFERENCES :
None.
Index: gdevpdf.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpdf.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- gdevpdf.c 6 Jun 2005 15:32:22 -0000 1.111
+++ gdevpdf.c 7 Jun 2005 16:41:24 -0000 1.112
@@ -497,7 +497,7 @@
0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A};
private inline void
-copy_padded(byte buf[32], gs_const_string *str)
+copy_padded(byte buf[32], gs_string *str)
{
memcpy(buf, str->data, min(str->size, 32));
if (32 > str->size)
Index: gdevpdfx.h
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpdfx.h,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- gdevpdfx.h 6 Jun 2005 15:32:22 -0000 1.118
+++ gdevpdfx.h 7 Jun 2005 16:41:24 -0000 1.119
@@ -431,8 +431,8 @@
(Bigger shadings to be downsampled). */
long MaxInlineImageSize;
/* Encryption parameters */
- gs_const_string OwnerPassword;
- gs_const_string UserPassword;
+ gs_string OwnerPassword;
+ gs_string UserPassword;
uint KeyLength;
uint Permissions;
uint EncryptionR;
@@ -443,7 +443,7 @@
byte EncryptionKey[16];
uint EncryptionV;
bool EncryptMetadata;
- gs_const_string NoEncrypt;
+ gs_string NoEncrypt;
/* Values derived from DSC comments */
bool is_EPS;
pdf_page_dsc_info_t doc_dsc_info; /* document default */
@@ -639,8 +639,9 @@
m(28,sbstack) m(29,substream_Resources) m(30,font3)\
m(31,accumulating_substream_resource)
#define gx_device_pdf_num_ptrs 32
-#define gx_device_pdf_do_strings(m) /* do nothing */
-#define gx_device_pdf_num_strings 0
+#define gx_device_pdf_do_strings(m)\
+ m(0, OwnerPassword) m(1, UserPassword) m(2, NoEncrypt)
+#define gx_device_pdf_num_strings 3
#define st_device_pdf_max_ptrs\
(st_device_psdf_max_ptrs + gx_device_pdf_num_ptrs +\
gx_device_pdf_num_strings +\
More information about the gs-cvs
mailing list