[FFmpeg-devel] [FFmpeg-cvslog] avutil/opt: add missing case for AV_OPT_TYPE_CHLAYOUT in av_opt_free()

James Almer jamrial at gmail.com
Sun Mar 20 19:04:53 EET 2022



On 3/20/2022 8:29 AM, Michael Niedermayer wrote:
> On Fri, Mar 18, 2022 at 10:00:17PM +0000, James Almer wrote:
>> ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Mar 18 18:46:40 2022 -0300| [327efa66331ebdc0087c6b656059a8df2f404019] | committer: James Almer
>>
>> avutil/opt: add missing case for AV_OPT_TYPE_CHLAYOUT in av_opt_free()
>>
>> Fixes potential memleaks for existing options of this type.
>>
>> Signed-off-by: James Almer <jamrial at gmail.com>
>>
>>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=327efa66331ebdc0087c6b656059a8df2f404019
>> ---
>>
>>   libavutil/opt.c | 4 ++++
>>   1 file changed, 4 insertions(+)
> 
> this removes most timestamps from
> libavformat/tests/seek ~/tickets/1605/08.rm -frames 10
> 
> ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.023000 pts: 0.023000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.046000 pts: 0.046000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.069000 pts: 0.069000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.092000 pts: 0.092000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.115000 pts: 0.115000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.138000 pts: 0.138000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.161000 pts: 0.161000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.184000 pts: 0.184000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.207000 pts: 0.207000 pos:     -1 size:    32
> ret: 0         st:-1 flags:0  ts:-1.000000
> ret: 0         st: 0 flags:1 dts: NOPTS    pts: NOPTS    pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: NOPTS    pts: NOPTS    pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: NOPTS    pts: NOPTS    pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: NOPTS    pts: NOPTS    pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: NOPTS    pts: NOPTS    pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: NOPTS    pts: NOPTS    pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: NOPTS    pts: NOPTS    pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: NOPTS    pts: NOPTS    pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: NOPTS    pts: NOPTS    pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: NOPTS    pts: NOPTS    pos:     -1 size:    32
> ...
> 
> vs.
> ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.023000 pts: 0.023000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.046000 pts: 0.046000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.069000 pts: 0.069000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.092000 pts: 0.092000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.115000 pts: 0.115000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.138000 pts: 0.138000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.161000 pts: 0.161000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.184000 pts: 0.184000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.207000 pts: 0.207000 pos:     -1 size:    32
> ret: 0         st:-1 flags:0  ts:-1.000000
> ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.023000 pts: 0.023000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.046000 pts: 0.046000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.069000 pts: 0.069000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.092000 pts: 0.092000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.115000 pts: 0.115000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.138000 pts: 0.138000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.161000 pts: 0.161000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.184000 pts: 0.184000 pos:     -1 size:    32
> ret: 0         st: 0 flags:1 dts: 0.207000 pts: 0.207000 pos:     -1 size:    32

Yes, this will be fixed by 
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220319030407.45503-1-jamrial@gmail.com/ 
or some other way to prevent ch_layout from being nuked by 
avcodec_close() in libavformat/demux.c


More information about the ffmpeg-devel mailing list