On 02/09/2014 04:07 AM, Kostya Shishkov wrote:
> On Sat, Feb 08, 2014 at 05:03:59PM -0500, Justin Ruggles wrote:
>> ---
>>  libavcodec/tiff.c |   11 ++++++-----
>>  1 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
>> index 9f8bc60..382f72c 100644
>> --- a/libavcodec/tiff.c
>> +++ b/libavcodec/tiff.c
>> @@ -321,7 +321,7 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t 
>> *start,
>>                             const uint8_t *buf, const uint8_t *end_buf)
>>  {
>>      unsigned tag, type, count, off, value = 0;
>> -    int i, j;
>> +    int i;
>>      uint32_t *pal;
>>      const uint8_t *rp, *gp, *bp;
>>  
>> @@ -527,10 +527,11 @@ static int tiff_decode_tag(TiffContext *s, const 
>> uint8_t *start,
>>          bp  = buf + count / 3 * off * 2;
>>          off = (type_sizes[type] - 1) << 3;
>>          for (i = 0; i < count / 3; i++) {
>> -            j      = (tget(&rp, type, s->le) >> off) << 16;
>> -            j     |= (tget(&gp, type, s->le) >> off) << 8;
>> -            j     |= tget(&bp, type, s->le) >> off;
>> -            pal[i] = j;
>> +            uint32_t p = 0xFF000000;
>> +            p |= (tget(&rp, type, s->le) >> off) << 16;
>> +            p |= (tget(&gp, type, s->le) >> off) << 8;
>> +            p |=  tget(&bp, type, s->le) >> off;
>> +            pal[i] = p;
>>          }
>>          s->palette_is_set = 1;
>>          break;
>> -- 
> 
> I don't think we need it.

Why not? If we don't set opaque alpha, conversion to rgb32 with swscale
will result in a completely transparent image. Also, there are codecs
such as png which actually can have alpha in the palette.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to