- for(i = 0; i < p2 * (c->bpp / 8); i++) {
- *output++ = *src++;
- }
- // RLE8 copy is actually padded - and runs are not!
- if(c->bpp == 8 && (p2 & 1)) {
- src++;
+ if ((c->bpp == 8) || (c->bpp == 24)) {
+ for(i = 0; i < p2 * (c->bpp / 8); i++) {
+ *output++ = *src++;
+ }
+ // RLE8 copy is actually padded - and runs are not!
+ if(c->bpp == 8 && (p2 & 1)) {
+ src++;
+ }
+ } else if (c->bpp == 16) {
+ for(i = 0; i < p2; i++) {
+ pix16 = AV_RL16(src);
+ src += 2;
+ *(uint16_t*)output = pix16;
+ output += 2;
+ }
+ } else if (c->bpp == 32) {
+ for(i = 0; i < p2; i++) {
+ pix32 = AV_RL32(src);
+ src += 4;
+ *(uint32_t*)output = pix32;
+ output += 4;
+ }