[FFmpeg-devel] [PATCH] examples/demuxing_decoding: use correct size of video_dst_data[0]

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Tue May 12 16:02:44 CEST 2015


On 12.05.2015 14:51, Michael Niedermayer wrote:
> On Tue, May 12, 2015 at 02:31:38PM +0200, Andreas Cadhalpun wrote:
>> @@ -108,6 +109,14 @@ static int decode_packet(int *got_frame, int cached)
>>                            (const uint8_t **)(frame->data), frame->linesize,
>>                            pix_fmt, width, height);
>>  
>> +            if ((desc->flags & AV_PIX_FMT_FLAG_PAL ||
>> +                 desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) &&
>> +                video_dst_data[1] - video_dst_data[0] > video_dst_linesize[0] * height) {
>> +                /* zero-initialize the padding before the palette */
>> +                memset(video_dst_data[0] + video_dst_linesize[0] * height, 0,
>> +                       video_dst_data[1] - video_dst_data[0] - video_dst_linesize[0] * height);
>> +            }
> 
> i wonder if this shouldnt be moved to av_image_alloc() ?

It's a bit nicer to do this in av_image_fill_pointers.
New patch attached.

Best regards,
Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-imgutils-initialize-palette-padding-bytes-in-av_imag.patch
Type: text/x-diff
Size: 1352 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150512/e85e8c9c/attachment.bin>


More information about the ffmpeg-devel mailing list