[vlc-devel] commit: Catch error case. (Jean-Paul Saman )

git version control git at videolan.org
Fri May 9 17:51:44 CEST 2008


vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Fri May  9 16:57:19 2008 +0200| [ed42c4a2f503b96c76cf00014a00b8a64aebe103]

Catch error case.

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

 modules/gui/fbosd.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/gui/fbosd.c b/modules/gui/fbosd.c
index 64ed7d3..2dcd29d 100644
--- a/modules/gui/fbosd.c
+++ b/modules/gui/fbosd.c
@@ -873,6 +873,11 @@ static picture_t *RenderText( intf_thread_t *p_intf, const char *psz_string,
         memset( p_region, 0, sizeof(subpicture_region_t) );
 
         p_region->psz_text = strdup( psz_string );
+        if( !p_region->psz_text )
+        {
+            free( p_region );
+            return NULL;
+        }
         p_region->p_style = p_style;
 
         p_region->fmt.i_chroma = VLC_FOURCC('T','E','X','T');




More information about the vlc-devel mailing list