Home | History | Annotate | Download | only in tools

Lines Matching refs:length

16  * uncompressed iTXt chunks.  Assumes that the actual length is greater
17 * than or equal to the value in the length byte, and that the CRC is
18 * correct for the actual length. This program hunts for the CRC and
19 * adjusts the length byte accordingly. It is not an error to process a
60 /* Read the length */
61 unsigned long length; /* must be 32 bits! */
62 GETBREAK; buf[0] = c; length = c; length <<= 8;
63 GETBREAK; buf[1] = c; length += c; length <<= 8;
64 GETBREAK; buf[2] = c; length += c; length <<= 8;
65 GETBREAK; buf[3] = c; length += c;
77 if (length >= MAX_LENGTH-12)
84 for (i=8; i < length + 12; i++)
93 crc = crc32(crc, buf+4, (uInt)length+4);
98 if (((crc >> 24) & 0xffU) == buf[length+8] &&
99 ((crc >> 16) & 0xffU) == buf[length+9] &&
100 ((crc >> 8) & 0xffU) == buf[length+10] &&
101 ((crc ) & 0xffU) == buf[length+11])
104 length++;
106 if (length >= MAX_LENGTH-12)
110 buf[length+11] = c;
113 crc = crc32(crc, buf+7+length, 1);
119 /* Update length bytes */
120 buf[0] = (unsigned char)((length >> 24) & 0xffU);
121 buf[1] = (unsigned char)((length >> 16) & 0xffU);
122 buf[2] = (unsigned char)((length >> 8) & 0xffU);
123 buf[3] = (unsigned char)((length ) & 0xffU);
125 /* Write the fixed iTXt chunk (length, name, data, crc) */
126 for (i=0; i<length+12; i++)
135 /* Copy bytes that were already read (length and chunk name) */
140 for (i=8; i< length+12; i++)