Revision dbfdb288

View differences:

libavcodec/bmp.c
245 245
        buf = buf0 + 14 + ihsize; //palette location
246 246
        if((hsize-ihsize-14) < (colors << 2)){ // OS/2 bitmap, 3 bytes per palette entry
247 247
            for(i = 0; i < colors; i++)
248
                ((uint32_t*)p->data[1])[i] = bytestream_get_le24(&buf);
248
                ((uint32_t*)p->data[1])[i] = (0xff<<24) | bytestream_get_le24(&buf);
249 249
        }else{
250 250
            for(i = 0; i < colors; i++)
251 251
                ((uint32_t*)p->data[1])[i] = bytestream_get_le32(&buf);
libavcodec/targa.c
189 189
            int r, g, b, t;
190 190
            int32_t *pal = ((int32_t*)p->data[1]) + first_clr;
191 191
            for(t = 0; t < colors; t++){
192
                r = *buf++;
193
                g = *buf++;
194 192
                b = *buf++;
195
                *pal++ = (b << 16) | (g << 8) | r;
193
                g = *buf++;
194
                r = *buf++;
195
                *pal++ = (0xff<<24) | (r << 16) | (g << 8) | b;
196 196
            }
197 197
            p->palette_has_changed = 1;
198 198
        }
libavcodec/tiff.c
429 429
        bp = buf + count / 3 * off * 2;
430 430
        off = (type_sizes[type] - 1) << 3;
431 431
        for(i = 0; i < count / 3; i++){
432
            j = (tget(&rp, type, s->le) >> off) << 16;
432
            j = 0xff << 24;
433
            j |= (tget(&rp, type, s->le) >> off) << 16;
433 434
            j |= (tget(&gp, type, s->le) >> off) << 8;
434 435
            j |= tget(&bp, type, s->le) >> off;
435 436
            pal[i] = j;
libswscale/swscale.c
1999 1999

  
2000 2000
    if (usePal(c->srcFormat)) {
2001 2001
        for (i=0; i<256; i++) {
2002
            int p, r, g, b,y,u,v;
2002
            int p, r, g, b, y, u, v, a = 0xff;
2003 2003
            if(c->srcFormat == PIX_FMT_PAL8) {
2004 2004
                p=((const uint32_t*)(src[1]))[i];
2005 2005
                r= (p>>16)&0xFF;
......
2028 2028
            y= av_clip_uint8((RY*r + GY*g + BY*b + ( 33<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT);
2029 2029
            u= av_clip_uint8((RU*r + GU*g + BU*b + (257<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT);
2030 2030
            v= av_clip_uint8((RV*r + GV*g + BV*b + (257<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT);
2031
            c->pal_yuv[i]= y + (u<<8) + (v<<16);
2031
            c->pal_yuv[i]= y + (u<<8) + (v<<16) + (a<<24);
2032 2032

  
2033 2033
            switch(c->dstFormat) {
2034 2034
            case PIX_FMT_BGR32:
2035 2035
#if !HAVE_BIGENDIAN
2036 2036
            case PIX_FMT_RGB24:
2037 2037
#endif
2038
                c->pal_rgb[i]=  r + (g<<8) + (b<<16);
2038
                c->pal_rgb[i]=  r + (g<<8) + (b<<16) + (a<<24);
2039 2039
                break;
2040 2040
            case PIX_FMT_BGR32_1:
2041 2041
#if HAVE_BIGENDIAN
2042 2042
            case PIX_FMT_BGR24:
2043 2043
#endif
2044
                c->pal_rgb[i]= (r + (g<<8) + (b<<16)) << 8;
2044
                c->pal_rgb[i]= a + (r<<8) + (g<<16) + (b<<24);
2045 2045
                break;
2046 2046
            case PIX_FMT_RGB32_1:
2047 2047
#if HAVE_BIGENDIAN
2048 2048
            case PIX_FMT_RGB24:
2049 2049
#endif
2050
                c->pal_rgb[i]= (b + (g<<8) + (r<<16)) << 8;
2050
                c->pal_rgb[i]= a + (b<<8) + (g<<16) + (r<<24);
2051 2051
                break;
2052 2052
            case PIX_FMT_RGB32:
2053 2053
#if !HAVE_BIGENDIAN
2054 2054
            case PIX_FMT_BGR24:
2055 2055
#endif
2056 2056
            default:
2057
                c->pal_rgb[i]=  b + (g<<8) + (r<<16);
2057
                c->pal_rgb[i]=  b + (g<<8) + (r<<16) + (a<<24);
2058 2058
            }
2059 2059
        }
2060 2060
    }

Also available in: Unified diff