[vlc-commits] image: fix i_codec not initialized as the i_chroma when reading URLs

Steve Lhomme git at videolan.org
Wed Feb 20 14:44:10 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Feb 20 14:41:58 2019 +0100| [df90f99b11460eb5531c7df7011ce23862406673] | committer: Steve Lhomme

image: fix i_codec not initialized as the i_chroma when reading URLs

Reported-by: Erwan Tulou <erwan10 at videolan.org>

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

 src/misc/image.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/misc/image.c b/src/misc/image.c
index 52edd0ff67..4fd8e3203a 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -301,23 +301,23 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
     if( p_block == NULL )
         goto error;
 
-    es_format_t fmtin;
-    es_format_Init( &fmtin, VIDEO_ES, 0 ); /* no chroma, the MIME type of the picture will be used */
-
+    vlc_fourcc_t i_chroma = 0;
     char *psz_mime = stream_MimeType( p_stream );
     if( psz_mime != NULL )
     {
-        fmtin.video.i_chroma = image_Mime2Fourcc( psz_mime );
+        i_chroma = image_Mime2Fourcc( psz_mime );
         free( psz_mime );
     }
-    if( !fmtin.video.i_chroma )
+    if( !i_chroma )
     {
        /* Try to guess format from file name */
-       fmtin.video.i_chroma = image_Ext2Fourcc( psz_url );
+       i_chroma = image_Ext2Fourcc( psz_url );
     }
     vlc_stream_Delete( p_stream );
 
 
+    es_format_t fmtin;
+    es_format_Init( &fmtin, VIDEO_ES, i_chroma );
     p_pic = ImageRead( p_image, p_block, &fmtin, p_fmt_out );
 
     es_format_Clean( &fmtin );



More information about the vlc-commits mailing list