}
if ((depth == 8) || (depth == 24)) {
- for(i = 0; i < p2 * (depth >> 3); i++) {
- *output++ = bytestream2_get_byteu(gb);
- }
+ bytestream2_get_bufferu(gb, output, p2 * (depth >> 3));
+ output += p2 * (depth >> 3);
+
// RLE8 copy is actually padded - and runs are not!
if(depth == 8 && (p2 & 1)) {
bytestream2_skip(gb, 1);
switch(depth){
case 8:
pix[0] = bytestream2_get_byte(gb);
- for(i = 0; i < p1; i++)
- *output++ = pix[0];
+ memset(output, pix[0], p1);
+ output += p1;
break;
case 16:
pix16 = bytestream2_get_le16(gb);