[vlc-devel] [PATCH] avcodec: copy frame-based palette

Rémi Denis-Courmont remi at remlab.net
Tue Jun 17 14:00:31 CEST 2014


Le 2014-06-16 14:33, Rémi Denis-Courmont a écrit :
> Le dimanche 15 juin 2014, 13:47:19 Daniel Verkamp a écrit :
>> ---
>>  modules/codec/avcodec/video.c  | 13 +++++++++++++
>>  modules/video_chroma/swscale.c |  8 ++++++--
>>  2 files changed, 19 insertions(+), 2 deletions(-)
>>
>> diff --git a/modules/codec/avcodec/video.c 
>> b/modules/codec/avcodec/video.c
>> index fd0a870..65c6773 100644
>> --- a/modules/codec/avcodec/video.c
>> +++ b/modules/codec/avcodec/video.c
>> @@ -852,6 +852,19 @@ static void ffmpeg_CopyPicture( decoder_t 
>> *p_dec,
>>          uint8_t *p_dst, *p_src;
>>          int i_src_stride, i_dst_stride;
>>
>> +        if( p_sys->p_context->pix_fmt == PIX_FMT_PAL8 )
>> +        {
>> +            if( !p_pic->format.p_palette )
>> +            {
>> +                p_pic->format.p_palette = calloc( 1,
>> sizeof(video_palette_t) ); +
>> p_pic->format.p_palette->i_entries = 256;
>> +            }
>> +            if( p_pic->format.p_palette )
>> +            {
>> +                memcpy( p_pic->format.p_palette->palette,
>> p_ff_pic->data[1], AVPALETTE_SIZE );
>> +            }
>> +        }
>
> I sense a reverse NULL check here.

And so does Coverity now.

-- 
Rémi Denis-Courmont



More information about the vlc-devel mailing list