[vlc-commits] [Git][videolan/vlc][master] mediacodec: release timestamp_fifo with video context
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Tue Mar 7 16:14:30 UTC 2023
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
1f7f400f by Thomas Guillem at 2023-03-07T15:44:21+00:00
mediacodec: release timestamp_fifo with video context
`CleanInputVideo()` is linked to the input side of the decoder
(.pf_decode) but `video.timestamp_fifo` can be used from the output side
(threads from mediacodec) and is actually also tied to the life cycle of
the video context, as visible in the destructor `CloseDecoder`. Since
the life cycle of the video context is at least the one from the input
side, destroy the timestamp_fifo there.
Fixes a use-after-free when the video context is not released from
CloseDestructor() while mediacodec is still running (not joined yet).
Regression from cdff503ed20f5e58aa35b330bfe9fd811c2b76a0 and
57323ddadbe6579697cc9ecdef0de2fbc6831dac
- - - - -
1 changed file:
- modules/codec/omxil/mediacodec.c
Changes:
=====================================
modules/codec/omxil/mediacodec.c
=====================================
@@ -746,9 +746,6 @@ static void CleanInputVideo(decoder_t *p_dec)
if (p_dec->fmt_in->i_codec == VLC_CODEC_H264
|| p_dec->fmt_in->i_codec == VLC_CODEC_HEVC)
hxxx_helper_clean(&p_sys->video.hh);
-
- if (p_sys->video.timestamp_fifo)
- timestamp_FifoRelease(p_sys->video.timestamp_fifo);
}
}
@@ -1057,6 +1054,9 @@ static void CleanDecoder(decoder_sys_t *p_sys)
if (p_sys->video.surfacetexture)
vlc_asurfacetexture_Delete(p_sys->video.surfacetexture);
+ if (p_sys->video.timestamp_fifo)
+ timestamp_FifoRelease(p_sys->video.timestamp_fifo);
+
free(p_sys);
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1f7f400ff74a80354efb467a5cb41b11a0cc98c8
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1f7f400ff74a80354efb467a5cb41b11a0cc98c8
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list