ffmpeg/fftools
Andreas Rheinhardt ced5c5fdb8 fftools/ffmpeg_mux_init: Fix double-free on error
MATCH_PER_STREAM_OPT iterates over all options of a given
OptionDef and tests whether they apply to the current stream;
if so, they are set to ost->apad, otherwise, the code errors
out. If no error happens, ost->apad is av_strdup'ed in order
to take ownership of this pointer.

But this means that setting it originally was premature,
as it leads to double-frees when an error happens lateron.
This can simply be reproduced with
ffmpeg -filter_complex anullsrc  -apad bar -apad:n baz -f null -
This is a regression since 83ace80bfd.

Fix this by using a temporary variable instead of directly
setting ost->apad. Also only strdup the string if it actually
is != NULL.

Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-26 06:48:35 +01:00
..
Makefile
cmdutils.c
cmdutils.h
ffmpeg.c
ffmpeg.h fftools/ffmpeg_filter: remove prototype for non existent function 2024-03-25 23:23:27 -03:00
ffmpeg_dec.c ffmpeg: set extra_hw_frames to account for frames held in queues 2024-03-19 22:56:56 +00:00
ffmpeg_demux.c
ffmpeg_enc.c fftools/ffmpeg_enc: Don't call frame_data twice 2024-03-22 22:11:04 +01:00
ffmpeg_filter.c fftools/ffmpeg_filter: remove unused struct from InputFilterPriv 2024-03-25 23:23:27 -03:00
ffmpeg_hw.c
ffmpeg_mux.c
ffmpeg_mux.h
ffmpeg_mux_init.c fftools/ffmpeg_mux_init: Fix double-free on error 2024-03-26 06:48:35 +01:00
ffmpeg_opt.c
ffmpeg_sched.c ffmpeg: set extra_hw_frames to account for frames held in queues 2024-03-19 22:56:56 +00:00
ffmpeg_sched.h ffmpeg: set extra_hw_frames to account for frames held in queues 2024-03-19 22:56:56 +00:00
ffmpeg_utils.h
ffplay.c
ffplay_renderer.c
ffplay_renderer.h
ffprobe.c ffprobe: adapt to new AVFilmGrainParams 2024-03-23 18:54:36 +01:00
fftools.manifest
fftoolsres.rc
fopen_utf8.h
objpool.c
objpool.h
opt_common.c
opt_common.h
sync_queue.c
sync_queue.h
thread_queue.c
thread_queue.h