aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/remux.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-25 16:54:25 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-26 06:48:35 +0100
commitced5c5fdb8634d39ca9472a2026b2d2fea16c4e5 (patch)
tree73bb793b56ae2f711d2758f5dc0508d7acc43a2f /doc/examples/remux.c
parent4a4dcde339b8e50f5cf77a6048bf665a2be27133 (diff)
downloadffmpeg-ced5c5fdb8634d39ca9472a2026b2d2fea16c4e5.tar.gz
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 83ace80bfd80fcdba2c65fa1d554923ea931d5bd. 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>
Diffstat (limited to 'doc/examples/remux.c')
0 files changed, 0 insertions, 0 deletions