]> git.sesse.net Git - vlc/blobdiff - modules/codec/csri.c
Fix corner case memory leak
[vlc] / modules / codec / csri.c
index 1df576254a96aceb3885f1da60c5af438669c4e8..780108d24f9b59b16335d93e71770d2a5e2de054 100644 (file)
@@ -28,7 +28,8 @@
 #include <string.h>
 
 #include "config.h"
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_vout.h>
 #include <vlc_codec.h>
 #include <vlc_osd.h>
@@ -63,8 +64,8 @@ static subpicture_region_t *UpdateRegions( video_format_t *, spu_t *,
  *****************************************************************************/
 
 vlc_module_begin();
-    set_shortname( _("Subtitles (advanced)"));
-    set_description( _("Wrapper for subtitle renderers using CSRI/asa") );
+    set_shortname( N_("Subtitles (advanced)"));
+    set_description( N_("Wrapper for subtitle renderers using CSRI/asa") );
     set_capability( "decoder", 60 );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_SCODEC );
@@ -125,10 +126,7 @@ static int Create( vlc_object_t *p_this )
 
     p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
     if( !p_sys )
-    {
-        msg_Err( p_dec, "out of memory" );
         return VLC_ENOMEM;
-    }
     memset( &p_dec->p_sys->fmt_cached, 0, sizeof( p_dec->p_sys->fmt_cached ) );
 
     p_sys->pf_push_packet = p_streamext->push_packet;
@@ -179,7 +177,6 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     p_spu->p_sys = malloc( sizeof( subpicture_sys_t ));
     if( !p_spu->p_sys )
     {
-        msg_Err( p_dec, "out of memory" );
         p_dec->pf_spu_buffer_del( p_dec, p_spu );
         block_Release( *pp_block );
         *pp_block = NULL;
@@ -191,7 +188,6 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     p_spu->p_sys->p_subs_data = malloc( p_block->i_buffer );
     if( !p_spu->p_sys->p_subs_data )
     {
-        msg_Err( p_dec, "out of memory" );
         free( p_spu->p_sys );
         p_dec->pf_spu_buffer_del( p_dec, p_spu );
         block_Release( *pp_block );