[FFmpeg-devel] n4.4 release bug (?) on ffmpeg.c av_fifo_generic_read

James Almer jamrial at gmail.com
Sun Apr 18 04:47:28 EEST 2021


On 4/17/2021 10:16 PM, Đông Nguyễn wrote:
> Hi,
> 
> Not sure this is the correct place to post this, but I've noticed some
> recent changes (n.4.4) on ffmpeg.c which seems suspicious to me.
> 
> https://github.com/FFmpeg/FFmpeg/blob/n4.4/fftools/ffmpeg.c#L532-L535

This one is in 4.3 too. Not sure why you think it was changed for 4.4.

> https://github.com/FFmpeg/FFmpeg/blob/n4.4/fftools/ffmpeg.c#L614-L616
> 
> IIRC, before these changes, av_fifo_generic_read operates on whole struct
> of AVFrame and AVPacket, not sole pointer (which has only 8 bytes on 64bit
> machine)
> 
> After that, calling "free" on those pointers potentially causes malloc heap
> crashes.
> 
> Please correct me if I'm wrong. Thanks

Both FIFOs effectively store pointers to dynamically allocated structs, 
and not entire structs. So reading sizeof(void*) worth of bytes is intended.

> 
> Dong Nguyen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 



More information about the ffmpeg-devel mailing list