[vlc-commits] vout: handle pool callback failure (fixes #14908)

Rémi Denis-Courmont git at videolan.org
Tue Dec 1 18:52:58 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Dec  1 19:34:48 2015 +0200| [93d6d9494cf45bb783517686a66a2403584e39d9] | committer: Rémi Denis-Courmont

vout: handle pool callback failure (fixes #14908)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=93d6d9494cf45bb783517686a66a2403584e39d9
---

 src/video_output/video_output.c |    4 +++-
 src/video_output/vout_wrapper.c |    3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 1c62d9b..5df9096 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -940,7 +940,9 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
 
     assert(vout_IsDisplayFiltered(vd) == !sys->display.use_dr);
     if (sys->display.use_dr && !is_direct) {
-        picture_t *direct = picture_pool_Get(vout->p->display_pool);
+        picture_t *direct = NULL;
+        if (likely(vout->p->display_pool != NULL))
+            direct = picture_pool_Get(vout->p->display_pool);
         if (!direct) {
             picture_Release(todisplay);
             if (subpic)
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index ce622b3..10c615e 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -133,6 +133,9 @@ int vout_InitWrapper(vout_thread_t *vout)
     const unsigned display_pool_size = allow_dr ? __MAX(VOUT_MAX_PICTURES,
                                                         reserved_picture + decoder_picture) : 3;
     picture_pool_t *display_pool = vout_display_Pool(vd, display_pool_size);
+    if (display_pool == NULL)
+        return VLC_EGENERIC;
+
 #ifndef NDEBUG
     if ( picture_pool_GetSize(display_pool) < display_pool_size )
         msg_Warn(vout, "Not enough display buffers in the pool, requested %d got %d",



More information about the vlc-commits mailing list