Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 105780 | Differences between
and this patch

Collapse All | Expand All

(-)hexen2source-1.4.2/hexenworld/Client/huffman.c (-4 / +12 lines)
Lines 226-240 void HuffDecode (unsigned char *in, unsi Link Here
226
	int	bits, tbits;
226
	int	bits, tbits;
227
	huffnode_t	*tmp;
227
	huffnode_t	*tmp;
228
228
229
	--inlen;
230
	if (inlen < 0)
231
	{
232
		*outlen = 0;
233
		return;
234
	}
229
	if (*in == 0xff)
235
	if (*in == 0xff)
230
	{
236
	{
231
		if (inlen > 1)
237
		if (inlen > maxlen)
232
			memcpy (out, in+1, inlen-1);
238
			memcpy (out, in+1, maxlen);
233
		*outlen = inlen-1;
239
		else if (inlen)
240
			memcpy (out, in+1, inlen);
241
		*outlen = inlen;
234
		return;
242
		return;
235
	}
243
	}
236
244
237
	tbits = (inlen-1)*8 - *in;
245
	tbits = inlen*8 - *in;
238
	bits = 0;
246
	bits = 0;
239
	*outlen = 0;
247
	*outlen = 0;
240
248
(-)hexen2source-1.4.2/hw_utils/hwrcon/huffman.c (-4 / +12 lines)
Lines 227-241 void HuffDecode (unsigned char *in, unsi Link Here
227
	int	bits, tbits;
227
	int	bits, tbits;
228
	huffnode_t	*tmp;
228
	huffnode_t	*tmp;
229
229
230
	--inlen;
231
	if (inlen < 0)
232
	{
233
		*outlen = 0;
234
		return;
235
	}
230
	if (*in == 0xff)
236
	if (*in == 0xff)
231
	{
237
	{
232
		if (inlen > 1)
238
		if (inlen > maxlen)
233
			memcpy (out, in+1, inlen-1);
239
			memcpy (out, in+1, maxlen);
234
		*outlen = inlen-1;
240
		else if (inlen)
241
			memcpy (out, in+1, inlen);
242
		*outlen = inlen;
235
		return;
243
		return;
236
	}
244
	}
237
245
238
	tbits = (inlen-1)*8 - *in;
246
	tbits = inlen*8 - *in;
239
	bits = 0;
247
	bits = 0;
240
	*outlen = 0;
248
	*outlen = 0;
241
249

Return to bug 105780