1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00
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
..
cmdutils.c
cmdutils.h
ffmpeg_dec.c
ffmpeg_demux.c
ffmpeg_enc.c
ffmpeg_filter.c fftools/ffmpeg_filter: remove unused struct from InputFilterPriv 2024-03-25 23:23:27 -03:00
ffmpeg_hw.c
ffmpeg_mux_init.c fftools/ffmpeg_mux_init: Fix double-free on error 2024-03-26 06:48:35 +01:00
ffmpeg_mux.c
ffmpeg_mux.h
ffmpeg_opt.c
ffmpeg_sched.c
ffmpeg_sched.h
ffmpeg_utils.h
ffmpeg.c
ffmpeg.h fftools/ffmpeg_filter: remove prototype for non existent function 2024-03-25 23:23:27 -03:00
ffplay_renderer.c
ffplay_renderer.h
ffplay.c
ffprobe.c
fftools.manifest
fftoolsres.rc
fopen_utf8.h
Makefile
objpool.c
objpool.h
opt_common.c
opt_common.h
sync_queue.c
sync_queue.h
thread_queue.c
thread_queue.h