[vlc-commits] [Git][videolan/vlc][master] vout: explicitly release picture_t
Romain Vimont (@rom1v)
gitlab at videolan.org
Wed Jul 14 16:33:29 UTC 2021
Romain Vimont pushed to branch master at VideoLAN / VLC
Commits:
8db45908 by Romain Vimont at 2021-07-14T16:13:08+00:00
vout: explicitly release picture_t
The picture_t was released implicitly from vout_dispay_Display().
If the caller explicitly wants to check if the display callback is NULL
for other reasons, they might be tempted to avoid calling
vout_display_Display() at all, which would leak the picture.
- - - - -
3 changed files:
- include/vlc_vout_display.h
- modules/video_output/splitter.c
- src/video_output/video_output.c
Changes:
=====================================
include/vlc_vout_display.h
=====================================
@@ -417,7 +417,6 @@ static inline void vout_display_Display(vout_display_t *vd, picture_t *picture)
{
if (vd->ops->display != NULL)
vd->ops->display(vd, picture);
- picture_Release(picture);
}
VLC_API
=====================================
modules/video_output/splitter.c
=====================================
@@ -86,7 +86,10 @@ static void vlc_vidsplit_Display(vout_display_t *vd, picture_t *picture)
struct vlc_vidsplit_part *part = &sys->parts[i];
if (sys->pictures[i] != NULL)
+ {
vout_display_Display(part->display, sys->pictures[i]);
+ picture_Release(sys->pictures[i]);
+ }
vlc_sem_post(&part->lock);
}
=====================================
src/video_output/video_output.c
=====================================
@@ -1370,6 +1370,8 @@ static int RenderPicture(vout_thread_sys_t *vout, bool render_now)
vout_display_Display(vd, todisplay);
vlc_mutex_unlock(&sys->display_lock);
+ picture_Release(todisplay);
+
if (subpic)
subpicture_Delete(subpic);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8db459085417a307bb18b77f1c0beeda3b97185e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8db459085417a307bb18b77f1c0beeda3b97185e
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list