summaryrefslogtreecommitdiff
path: root/devices/gdevhl7x.c
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2017-09-03 17:14:41 +0100
committerKen Sharp <ken.sharp@artifex.com>2017-09-03 17:14:41 +0100
commit5f73a2c82f0cbd0d0965709066ebdf13cc0b9c9d (patch)
treebc2322eeec7c8345f1771f92cf3df61468303eb6 /devices/gdevhl7x.c
parent4e122728ecf07941e15f75fc7feaec57eeb54e90 (diff)
downloadghostpdl-5f73a2c82f0cbd0d0965709066ebdf13cc0b9c9d.tar.gz
Coverity ID 94489
The spec says that it must be 3 bytes, and uses a 16 bit shift example (suggesting it is stored in the Brother driver as 24 bits). For us its a short, so rather than copy the brother code, set it to 0 to avoid any confusion over whether shifting a short right by 16 results in all 0 or all 1.
Diffstat (limited to 'devices/gdevhl7x.c')
-rw-r--r--devices/gdevhl7x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/devices/gdevhl7x.c b/devices/gdevhl7x.c
index cec785210..fa46d627d 100644
--- a/devices/gdevhl7x.c
+++ b/devices/gdevhl7x.c
@@ -536,7 +536,7 @@ static int dumpPage(gx_device_printer * pSource,
short size = pCommandList->current - HL7X0_LENGTH;
*(pSaveCommandStart++) = '@';
*(pSaveCommandStart++) = 'G';
- *(pSaveCommandStart++) = (Byte) (size >> 16);
+ *(pSaveCommandStart++) = 0; /* was: (Byte) (size >> 16) as per hte spec, but shorts cannot exceed 16 bits! */
*(pSaveCommandStart++) = (Byte) (size >> 8);
*(pSaveCommandStart++) = (Byte) (size);
}