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

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Tue May 12 14:32:54 CEST 2015


On 12.05.2015 11:17, wm4 wrote:
> On Mon, 11 May 2015 23:34:32 +0200
> Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> wrote:
>> @@ -109,7 +108,7 @@ static int decode_packet(int *got_frame, int cached)
>>                            pix_fmt, width, height);
>>  
>>              /* write to rawvideo file */
>> -            fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file);
>> +            fwrite(video_dst_data[0], 1, video_dst_linesize[0] * height, video_dst_file);
> 
> This would still write the line padding to the file, wouldn't it?

It wouldn't, because the video_dst_data buffer has no line padding.
(That's the only purpose of this buffer, see the comment above av_image_copy.)

> This
> means it wouldn't write the full frame, _and_ each line would have
> garbage at the end of it.
> 
> (Also I can't make sense of these examples...)

This one is quite useful for fuzzing, because it has much less overhead than ffmpeg.

Best regards,
Andreas


More information about the ffmpeg-devel mailing list