# HG changeset patch # User melanson # Date 1134547323 0 # Node ID 8f732838179dfe9c32ebfe571809db5e0e8f03a3 # Parent c8fa6a50fca53086a26c04845856a1105c5a3fc5 correctly deal with the alpha channel in 32-bit QT RLE (courtesy of John Koleszar ) diff -r c8fa6a50fca5 -r 8f732838179d qtrle.c --- a/qtrle.c Wed Dec 14 00:19:01 2005 +0000 +++ b/qtrle.c Wed Dec 14 08:02:03 2005 +0000 @@ -411,7 +411,7 @@ int rle_code; int row_ptr, pixel_ptr; int row_inc = s->frame.linesize[0]; - unsigned char r, g, b; + unsigned char a, r, g, b; unsigned int argb; unsigned char *rgb = s->frame.data[0]; int pixel_limit = s->frame.linesize[0] * s->avctx->height; @@ -455,11 +455,11 @@ /* decode the run length code */ rle_code = -rle_code; CHECK_STREAM_PTR(4); - stream_ptr++; /* skip the alpha (?) byte */ + a = s->buf[stream_ptr++]; r = s->buf[stream_ptr++]; g = s->buf[stream_ptr++]; b = s->buf[stream_ptr++]; - argb = (r << 16) | (g << 8) | (b << 0); + argb = (a << 24) | (r << 16) | (g << 8) | (b << 0); CHECK_PIXEL_PTR(rle_code * 4); @@ -473,11 +473,11 @@ /* copy pixels directly to output */ while (rle_code--) { - stream_ptr++; /* skip the alpha (?) byte */ + a = s->buf[stream_ptr++]; r = s->buf[stream_ptr++]; g = s->buf[stream_ptr++]; b = s->buf[stream_ptr++]; - argb = (r << 16) | (g << 8) | (b << 0); + argb = (a << 24) | (r << 16) | (g << 8) | (b << 0); *(unsigned int *)(&rgb[pixel_ptr]) = argb; pixel_ptr += 4; }