]> git.sesse.net Git - vlc/blobdiff - modules/codec/cinepak.c
Split should now be complete (postproc still needs to be fixed).
[vlc] / modules / codec / cinepak.c
index 75d103a6d7bd23e683e159e831fcd6aced01afb8..fadcc2a7dfb176380ecfb8118e5346f785af9795 100644 (file)
@@ -28,7 +28,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_vout.h>
 #include <vlc_codec.h>
 
@@ -39,7 +40,7 @@ static int  OpenDecoder ( vlc_object_t * );
 static void CloseDecoder( vlc_object_t * );
 
 vlc_module_begin();
-    set_description( _("Cinepak video decoder") );
+    set_description( N_("Cinepak video decoder") );
     set_capability( "decoder", 100 );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_VCODEC );
@@ -115,10 +116,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     /* Allocate the memory needed to store the decoder's structure */
     if( ( p_dec->p_sys = p_sys = malloc(sizeof(decoder_sys_t)) ) == NULL )
-    {
-        msg_Err( p_dec, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
     memset( &p_sys->context, 0, sizeof( cinepak_context_t ) );
 
     var_Create( p_dec, "grayscale", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
@@ -447,6 +445,8 @@ static int cinepak_decode_frame( cinepak_context_t *p_context,
         {
             p_context->p_pix[i] = malloc( p_context->i_stride[i] *
                                           p_context->i_lines[i] );
+            if( p_context->p_pix[i] == NULL )
+                return -1;
             /* Set it to all black */
             memset( p_context->p_pix[i], ( i == 0 ) ? 0 : 128 ,
                     p_context->i_stride[i] * p_context->i_lines[i] );