[vlc-commits] decoder: return early in decoder_UpdateVideoFormat()
Steve Lhomme
git at videolan.org
Mon Feb 18 17:02:54 CET 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 18 15:58:10 2019 +0100| [ba1604d7ee426498802411a2e6d746cc10796d35] | committer: Steve Lhomme
decoder: return early in decoder_UpdateVideoFormat()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ba1604d7ee426498802411a2e6d746cc10796d35
---
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 d651fa581d..3cc02de8d6 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -75,10 +75,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 )
More information about the vlc-commits
mailing list