2 * xDMS v1.3 - Portable DMS archive unpacker - Public Domain
3 * Written by Andre Rodrigues de la Rocha <adlroc@usa.net>
5 * Run Length Encoding decompression function used in most
6 * modes after decompression by other algorithm
12 UWORD
Unpack_RLE (struct xdms_data
*xdms
, UBYTE
*in
, UBYTE
*out
, UWORD origsize
) {
16 outend
= out
+origsize
;
18 if ((a
= *in
++) != 0x90)
20 else if (!(b
= *in
++))
26 n
= (UWORD
)((n
<<8) + *in
++);
29 if (out
+n
> outend
) return 1;
30 memset(out
,a
,(size_t) n
);