[vlc-commits] [Git][videolan/vlc][master] 2 commits: decoder_helpers: fix potential leak when enc module isn't set
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Thu Apr 7 16:29:01 UTC 2022
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
8cf2d121 by Alaric Senat at 2022-04-07T16:04:35+00:00
decoder_helpers: fix potential leak when enc module isn't set
Prefer clearing object resources instead of calling `module_unneed`
which isn't set in all cases.
- - - - -
99c942f3 by Alaric Senat at 2022-04-07T16:04:35+00:00
transcode: fix `_video_test` double-free
The encoder is now fully deallocated by `vlc_encoder_Destroy` below.
- - - - -
2 changed files:
- modules/stream_out/transcode/encoder/video.c
- src/input/decoder_helpers.c
Changes:
=====================================
modules/stream_out/transcode/encoder/video.c
=====================================
@@ -334,12 +334,6 @@ int transcode_encoder_video_test( encoder_t *p_encoder,
p_cfg->psz_name ? p_cfg->psz_name : "any",
(char *)&p_cfg->i_codec );
}
- else
- {
- /* Close the encoder.
- * We'll open it only when we have the first frame. */
- module_unneed( p_encoder, p_module );
- }
if( likely(!p_encoder->fmt_in.video.i_chroma) ) /* always missing, and required by filter chain */
p_encoder->fmt_in.video.i_chroma = p_encoder->fmt_in.i_codec;
=====================================
src/input/decoder_helpers.c
=====================================
@@ -306,11 +306,10 @@ void vlc_encoder_Destroy(encoder_t *encoder)
{
if (encoder->ops != NULL && encoder->ops->close != NULL)
encoder->ops->close(encoder);
- if (encoder->p_module != NULL)
- module_unneed(encoder, encoder->p_module);
es_format_Clean(&encoder->fmt_in);
es_format_Clean(&encoder->fmt_out);
+ vlc_objres_clear(VLC_OBJECT(encoder));
vlc_object_delete(encoder);
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/595fd0c8c0b7c1f8e3e0104bf66ca7a07ea2a323...99c942f373cce6ae4e9ecd2008c59b894863b198
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/595fd0c8c0b7c1f8e3e0104bf66ca7a07ea2a323...99c942f373cce6ae4e9ecd2008c59b894863b198
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