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

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Tue May 12 21:48:45 CEST 2015


On 12.05.2015 21:12, Michael Niedermayer wrote:
> On Tue, May 12, 2015 at 04:02:44PM +0200, Andreas Cadhalpun wrote:
>> 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.
> 
> yes but thats not safe
> 
> for example rawdec calls avpicture_fill() on the input buffer
> which uses av_image_fill_pointers()

OK, then let's do it in av_image_alloc.

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: 1401 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150512/a6285f42/attachment.bin>


More information about the ffmpeg-devel mailing list