[vlc-commits] [Git][videolan/vlc][master] decoder_helpers: reject "codec" that are not chromas early

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Oct 21 16:49:08 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
1606e027 by Steve Lhomme at 2023-10-21T16:35:11+00:00
decoder_helpers: reject "codec" that are not chromas early

The format_update will ultimately fail because it can't create a picture pool
in the vout.

In practice this should never happen because such decoder would not work
in the end.

- - - - -


1 changed file:

- src/input/decoder_helpers.c


Changes:

=====================================
src/input/decoder_helpers.c
=====================================
@@ -89,6 +89,11 @@ int decoder_UpdateVideoOutput( decoder_t *dec, vlc_video_context *vctx_out )
         return -1;
 
     /* */
+    const vlc_chroma_description_t *dsc =
+        vlc_fourcc_GetChromaDescription(dec->fmt_out.i_codec);
+    if (unlikely(dsc == NULL))
+        // the "codec" must be a valid picture chroma
+        return -1;
     dec->fmt_out.video.i_chroma = dec->fmt_out.i_codec;
 
     if( dec->fmt_out.video.i_visible_height == 1088 &&
@@ -114,7 +119,6 @@ int decoder_UpdateVideoOutput( decoder_t *dec, vlc_video_context *vctx_out )
 
     if( vlc_fourcc_IsYUV( dec->fmt_out.video.i_chroma ) )
     {
-        const vlc_chroma_description_t *dsc = vlc_fourcc_GetChromaDescription( dec->fmt_out.video.i_chroma );
         for( unsigned int i = 0; dsc && i < dsc->plane_count; i++ )
         {
             while( dec->fmt_out.video.i_width % dsc->p[i].w.den )



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1606e027532c0141c93d9f7e7637f42e5f54ead4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1606e027532c0141c93d9f7e7637f42e5f54ead4
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list