rpms/hplip/devel hplip-alloc.patch,NONE,1.1 hplip.spec,1.170,1.171

Tim Waugh (twaugh) fedora-extras-commits at redhat.com
Fri Jan 25 12:38:16 UTC 2008


Author: twaugh

Update of /cvs/pkgs/rpms/hplip/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19477

Modified Files:
	hplip.spec 
Added Files:
	hplip-alloc.patch 
Log Message:
* Fri Jan 25 2008 Tim Waugh <twaugh at redhat.com> 2.7.12-4
- The hpijs compression module doesn't allocate enough memory (bug #428536).


hplip-alloc.patch:

--- NEW FILE hplip-alloc.patch ---
diff -up hplip-2.7.12/prnt/hpijs/compression.cpp.alloc hplip-2.7.12/prnt/hpijs/compression.cpp
--- hplip-2.7.12/prnt/hpijs/compression.cpp.alloc	2008-01-25 12:16:45.000000000 +0000
+++ hplip-2.7.12/prnt/hpijs/compression.cpp	2008-01-25 12:18:02.000000000 +0000
@@ -104,12 +104,12 @@ Mode9::Mode9 (SystemServices* pSys,unsig
     if (constructor_error != NO_ERROR)  // if error in base constructor
         return;
 
-	// In the worst case, compression expands data by 50%
-	compressBuf = (BYTE*)pSS->AllocMem(RasterSize + RasterSize/2);
+	// In the worst case, compression expands data by 100%
+	compressBuf = (BYTE*)pSS->AllocMem(2 * RasterSize);
 	if (compressBuf == NULL)
 		constructor_error=ALLOCMEM_ERROR;
 
-	memset(compressBuf, 0, RasterSize + RasterSize/2);
+	memset(compressBuf, 0, 2 * RasterSize);
     memset(SeedRow,0,RasterSize);
 
 	ResetSeedRow = FALSE;
@@ -199,7 +199,7 @@ BOOL Mode9::Process(RASTERDATA* input)
 		return TRUE;
 	}
 
-	memset(compressBuf, 0, inputsize + inputsize/2);
+	memset(compressBuf, 0, 2 * inputsize);
 
     unsigned int originalsize=input->rastersize[myplane];
 	unsigned int size=input->rastersize[myplane];
@@ -571,7 +571,7 @@ Mode3::Mode3 (SystemServices* pSys, Prin
     // Worst case is when two rows are completely different
     // In that case, one command byte is added for every 8 bytes
 		// In the worst case, compression expands data by 50%
-	compressBuf = (BYTE*)pSS->AllocMem(RasterSize + RasterSize/2);
+	compressBuf = (BYTE*)pSS->AllocMem(2 * RasterSize);
 	if (compressBuf == NULL)
 		constructor_error=ALLOCMEM_ERROR;
 	


Index: hplip.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hplip/devel/hplip.spec,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -r1.170 -r1.171
--- hplip.spec	23 Jan 2008 17:02:05 -0000	1.170
+++ hplip.spec	25 Jan 2008 12:37:35 -0000	1.171
@@ -1,7 +1,7 @@
 Summary: HP Linux Imaging and Printing Project
 Name: hplip
 Version: 2.7.12
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2+ and MIT
 Group: System Environment/Daemons
 Conflicts: system-config-printer < 0.6.132
@@ -19,6 +19,7 @@
 Patch3: hplip-quiet.patch
 Patch4: hplip-marker-supply.patch
 Patch5: hplip-libm.patch
+Patch6: hplip-alloc.patch
 Patch8: hplip-libsane.patch
 Patch9: hplip-media-empty.patch
 Patch11: hplip-unload-traceback.patch
@@ -108,6 +109,9 @@
 # libhpip should link against libm (bug #197599).
 %patch5 -p1 -b .libm
 
+# The hpijs compression module doesn't allocate enough memory (bug #428536).
+%patch6 -p1 -b .alloc
+
 # Link libsane-hpaio against libsane (bug #234813).
 %patch8 -p1 -b .libsane
 
@@ -280,6 +284,9 @@
 exit 0
 
 %changelog
+* Fri Jan 25 2008 Tim Waugh <twaugh at redhat.com> 2.7.12-4
+- The hpijs compression module doesn't allocate enough memory (bug #428536).
+
 * Wed Jan 23 2008 Tim Waugh <twaugh at redhat.com> 2.7.12-3
 - Really grant the ACL for the lp group (bug #424331).
 




More information about the fedora-extras-commits mailing list