[vlc-commits] text_renderer: reject incorrect pixbuf

Francois Cartegnie git at videolan.org
Tue Dec 6 20:53:33 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Dec  6 20:52:12 2016 +0100| [2c541dcdaafc06d31acb4fd1c43ec35622385986] | committer: Francois Cartegnie

text_renderer: reject incorrect pixbuf

potential read overflow

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

 modules/text_renderer/svg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/text_renderer/svg.c b/modules/text_renderer/svg.c
index 46a9d90..3e96891 100644
--- a/modules/text_renderer/svg.c
+++ b/modules/text_renderer/svg.c
@@ -265,7 +265,9 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
     i_width = gdk_pixbuf_get_width( p_svg->p_rendition );
     i_height = gdk_pixbuf_get_height( p_svg->p_rendition );
 
-    if( gdk_pixbuf_get_colorspace( p_svg->p_rendition ) != GDK_COLORSPACE_RGB )
+    if( gdk_pixbuf_get_colorspace( p_svg->p_rendition ) != GDK_COLORSPACE_RGB ||
+        gdk_pixbuf_get_has_alpha( p_svg->p_rendition ) != TRUE ||
+        gdk_pixbuf_get_bits_per_sample( p_svg->p_rendition ) != 8 )
     {
         g_object_unref( p_svg->p_rendition );
         p_svg->p_rendition = NULL;



More information about the vlc-commits mailing list