diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-11 13:45:31 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-04-08 11:52:52 +0200 |
commit | aa8f8748caa15d99a77537cbd5bbec014a6630b8 (patch) | |
tree | 5524b7e9e5fa8a202025dd6ec33d5af383a80fde /libavcodec/opus_parser.c | |
parent | 04012468459fb896e3a24202d7cc69b1cdda1db4 (diff) | |
download | ffmpeg-aa8f8748caa15d99a77537cbd5bbec014a6630b8.tar.gz |
avcodec/pthread_frame: Fix cleanup during init
In case an error happened when setting up the child threads,
ff_frame_thread_init() would up until now call ff_frame_thread_free()
to clean up all threads set up so far, including the current, not
properly initialized one.
But a half-allocated context needs special handling which
ff_frame_thread_frame_free() doesn't provide.
Notably, if allocating the AVCodecInternal, the codec's private data
or setting the options fails, the codec's close function will be
called (if there is one); it will also be called if the codec's init
function fails, regardless of whether the FF_CODEC_CAP_INIT_CLEANUP
is set. This is not supported by all codecs; in ticket #9099 it led
to a crash.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit e9b66175793e5c2af19beefe8e143f6e4901b5df)
Diffstat (limited to 'libavcodec/opus_parser.c')
0 files changed, 0 insertions, 0 deletions