[vlc-commits] decoder: check missing picture dates early

Steve Lhomme git at videolan.org
Tue Sep 3 10:12:19 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Aug 27 07:10:24 2019 +0200| [bc846238495ae752c8b0fff30ec8aa21d750da1a] | committer: Steve Lhomme

decoder: check missing picture dates early

Especially before we check this date against the i_preroll_end.

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

 src/input/decoder.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 0590f1d65b..faedada0a3 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -979,6 +979,14 @@ static int DecoderPlayVideo( struct decoder_owner *p_owner, picture_t *p_picture
     vout_thread_t  *p_vout = p_owner->p_vout;
     bool prerolled;
 
+    if( p_picture->date == VLC_TICK_INVALID )
+        /* FIXME: VLC_TICK_INVALID -- verify video_output */
+    {
+        msg_Warn( p_dec, "non-dated video buffer received" );
+        picture_Release( p_picture );
+        return VLC_EGENERIC;
+    }
+
     vlc_mutex_lock( &p_owner->lock );
     if( p_owner->i_preroll_end > p_picture->date )
     {
@@ -999,12 +1007,6 @@ static int DecoderPlayVideo( struct decoder_owner *p_owner, picture_t *p_picture
             vout_FlushAll( p_vout );
     }
 
-    if( p_picture->date == VLC_TICK_INVALID )
-    {
-        msg_Warn( p_dec, "non-dated video buffer received" );
-        goto discard;
-    }
-
     /* */
     vlc_mutex_lock( &p_owner->lock );
 



More information about the vlc-commits mailing list