[vlc-devel] [PATCH]: fix regression in ImageReadUrl

erwan.tulou at gmail.com erwan.tulou at gmail.com
Tue Feb 19 14:11:40 CET 2019


Hello,

    The patch is intended to fix i_codec (within es_format_t) no longer 
properly initialized after some recent refactoring.

     A direct consequence was the skins2 engine no longer displaying any 
still images.

Regards
Erwan Tulou



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
-------------- next part --------------
From 88bdf864f9b4d6c51c83933c6938c9fd5d15841f Mon Sep 17 00:00:00 2001
From: Erwan Tulou <erwan10 at videolan.org>
Date: Tue, 19 Feb 2019 13:08:58 +0100
Subject: [PATCH] image: fix ImageReadUrl()

i_codec (within es_format_t) was no longer properly initialized after some
recent refactoring, therefore failing to decode any image. This accounted
for the skins2 engine no longer able to display anything.
---
 src/misc/image.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/misc/image.c b/src/misc/image.c
index 52edd0ff67..a21b82f498 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -301,22 +301,25 @@ 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 */
+    video_format_t fmtvideo;
+    video_format_Init( &fmtvideo, 0 );
 
     char *psz_mime = stream_MimeType( p_stream );
     if( psz_mime != NULL )
     {
-        fmtin.video.i_chroma = image_Mime2Fourcc( psz_mime );
+        fmtvideo.i_chroma = image_Mime2Fourcc( psz_mime );
         free( psz_mime );
     }
-    if( !fmtin.video.i_chroma )
+    if( !fmtvideo.i_chroma )
     {
        /* Try to guess format from file name */
-       fmtin.video.i_chroma = image_Ext2Fourcc( psz_url );
+       fmtvideo.i_chroma = image_Ext2Fourcc( psz_url );
     }
     vlc_stream_Delete( p_stream );
 
+    es_format_t fmtin;
+    es_format_InitFromVideo( &fmtin, &fmtvideo );
+    video_format_Clean( &fmtvideo );
 
     p_pic = ImageRead( p_image, p_block, &fmtin, p_fmt_out );
 
-- 
2.20.1



More information about the vlc-devel mailing list