[vlc-devel] [PATCH 05/13] decoder: ensure we don't use invalid decoder sizes for the chroma in use

Rémi Denis-Courmont remi at remlab.net
Tue Feb 19 11:09:48 CET 2019


Doing that *before* checking the visible dimensions was probably wrong and probably still is.

Le 19 février 2019 11:38:18 GMT+02:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>---
> src/input/decoder.c         | 12 ------------
> src/input/decoder_helpers.c | 12 ++++++++++++
> 2 files changed, 12 insertions(+), 12 deletions(-)
>
>diff --git a/src/input/decoder.c b/src/input/decoder.c
>index 16e88702b7..f87e418551 100644
>--- a/src/input/decoder.c
>+++ b/src/input/decoder.c
>@@ -456,18 +456,6 @@ static int vout_update_format( decoder_t *p_dec )
> 
>         video_format_t fmt = p_dec->fmt_out.video;
> 
>-        if( vlc_fourcc_IsYUV( fmt.i_chroma ) )
>-        {
>-            const vlc_chroma_description_t *dsc =
>vlc_fourcc_GetChromaDescription( fmt.i_chroma );
>-            for( unsigned int i = 0; dsc && i < dsc->plane_count; i++
>)
>-            {
>-                while( fmt.i_width % dsc->p[i].w.den )
>-                    fmt.i_width++;
>-                while( fmt.i_height % dsc->p[i].h.den )
>-                    fmt.i_height++;
>-            }
>-        }
>-
>         if( !fmt.i_visible_width || !fmt.i_visible_height )
>         {
>             if( p_dec->fmt_in.video.i_visible_width &&
>diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
>index b738525b1e..36043753ca 100644
>--- a/src/input/decoder_helpers.c
>+++ b/src/input/decoder_helpers.c
>@@ -96,6 +96,18 @@ int decoder_UpdateVideoFormat( decoder_t *dec )
> 
> dec->fmt_out.video.i_chroma = fmt_out.i_chroma = dec->fmt_out.i_codec;
> 
>+    if( vlc_fourcc_IsYUV( fmt_out.i_chroma ) )
>+    {
>+        const vlc_chroma_description_t *dsc =
>vlc_fourcc_GetChromaDescription( fmt_out.i_chroma );
>+        for( unsigned int i = 0; dsc && i < dsc->plane_count; i++ )
>+        {
>+            while( fmt_out.i_width % dsc->p[i].w.den )
>+                fmt_out.i_width++;
>+            while( fmt_out.i_height % dsc->p[i].h.den )
>+                fmt_out.i_height++;
>+        }
>+    }
>+
>     video_format_t original = dec->fmt_out.video;
>     dec->fmt_out.video = fmt_out;
>     int err = dec->cbs->video.format_update( dec );
>-- 
>2.17.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190219/7261ef56/attachment.html>


More information about the vlc-devel mailing list