]> git.sesse.net Git - vlc/blobdiff - modules/codec/subtitles/subsdec.c
Do not assert memory allocations
[vlc] / modules / codec / subtitles / subsdec.c
index d1b7572e44f53d7e8702fb379d25cef1b015e838..121f171705c7b5b9126f41c4c4a8633e42f23763 100644 (file)
@@ -31,8 +31,6 @@
 # include "config.h"
 #endif
 
-#include <assert.h>
-
 #include "subsdec.h"
 #include <vlc_plugin.h>
 
@@ -456,12 +454,10 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
         {
             size_t inbytes_left = strlen( psz_subtitle );
             size_t outbytes_left = 6 * inbytes_left;
-            char *psz_new_subtitle = malloc( outbytes_left + 1 );
+            char *psz_new_subtitle = xmalloc( outbytes_left + 1 );
             char *psz_convert_buffer_out = psz_new_subtitle;
             const char *psz_convert_buffer_in = psz_subtitle;
 
-            assert( psz_new_subtitle );
-
             size_t ret = vlc_iconv( p_sys->iconv_handle,
                                     &psz_convert_buffer_in, &inbytes_left,
                                     &psz_convert_buffer_out, &outbytes_left );