Commit 4ca43f74 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

osd_text: Fix a bad vasprintf usage.

parent 60b953e3
...@@ -123,18 +123,20 @@ int osd_ShowTextAbsolute( spu_t *p_spu_channel, int i_channel, ...@@ -123,18 +123,20 @@ int osd_ShowTextAbsolute( spu_t *p_spu_channel, int i_channel,
void osd_Message( spu_t *p_spu, int i_channel, void osd_Message( spu_t *p_spu, int i_channel,
char *psz_format, ... ) char *psz_format, ... )
{ {
char *psz_string;
va_list args; va_list args;
if( p_spu ) if( p_spu )
{ {
char *psz_string;
va_start( args, psz_format ); va_start( args, psz_format );
vasprintf( &psz_string, psz_format, args ); if( vasprintf( &psz_string, psz_format, args ) != -1 )
{
osd_ShowTextRelative( p_spu, i_channel, psz_string, NULL, osd_ShowTextRelative( p_spu, i_channel, psz_string, NULL,
OSD_ALIGN_TOP|OSD_ALIGN_RIGHT, 30,20,1000000 ); OSD_ALIGN_TOP|OSD_ALIGN_RIGHT, 30,20,1000000 );
free( psz_string ); free( psz_string );
}
va_end( args ); va_end( args );
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment