- The hpijs compression module doesn't allocate enough memory (bug

#428536).
This commit is contained in:
Tim Waugh 2008-01-25 12:37:35 +00:00
parent 14acbaa39d
commit 1c070b41b5
2 changed files with 45 additions and 1 deletions

37
hplip-alloc.patch Normal file
View File

@ -0,0 +1,37 @@
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;

View File

@ -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 @@ Patch2: hplip-gzip-n.patch
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 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version}
# 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 @@ fi
exit 0
%changelog
* Fri Jan 25 2008 Tim Waugh <twaugh@redhat.com> 2.7.12-4
- The hpijs compression module doesn't allocate enough memory (bug #428536).
* Wed Jan 23 2008 Tim Waugh <twaugh@redhat.com> 2.7.12-3
- Really grant the ACL for the lp group (bug #424331).