vlc | branch: master | Steve Lhomme <[email protected]> | Mon Feb 18 15:58:10 
2019 +0100| [1f548bdd1c058f376670eed57de5e18333e04acd] | committer: Steve Lhomme

decoder: return early in decoder_UpdateVideoFormat()

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

 src/input/decoder_helpers.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
index ff1ae04b81..315cd1d22c 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -76,10 +76,11 @@ void decoder_Destroy( decoder_t **p_dec )
 int decoder_UpdateVideoFormat( decoder_t *dec )
 {
     vlc_assert( dec->fmt_in.i_cat == VIDEO_ES && dec->cbs != NULL );
+    if ( unlikely(dec->fmt_in.i_cat != VIDEO_ES || dec->cbs == NULL ||
+                  dec->cbs->video.format_update == NULL) )
+        return -1;
 
-    if( dec->fmt_in.i_cat == VIDEO_ES && dec->cbs->video.format_update != NULL 
)
-        return dec->cbs->video.format_update( dec );
-    return -1;
+    return dec->cbs->video.format_update( dec );
 }
 
 picture_t *decoder_NewPicture( decoder_t *dec )

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to