]> git.sesse.net Git - vlc/blobdiff - modules/codec/kate.c
mpga: use VLC_TS_INVALID (refs #3135)
[vlc] / modules / codec / kate.c
index 0c5f89a97909366e2a3d98a1c8b94e4f2adf190a..3dee69247d5a1233ee7669f4cc60dbd1a0c95135 100644 (file)
@@ -371,7 +371,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     p_sys->b_packetizer = false;
 #endif
     p_sys->b_ready = false;
-    p_sys->i_pts = 0;
+    p_sys->i_pts =
     p_sys->i_max_stop = VLC_TS_INVALID;
 
     kate_comment_init( &p_sys->kc );
@@ -503,8 +503,8 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         /* Backup headers as extra data */
         uint8_t *p_extra;
 
-        p_dec->fmt_in.p_extra =
-            realloc( p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra + kp.nbytes + 2 );
+        p_dec->fmt_in.p_extra = xrealloc( p_dec->fmt_in.p_extra,
+                                      p_dec->fmt_in.i_extra + kp.nbytes + 2 );
         p_extra = (void*)(((unsigned char*)p_dec->fmt_in.p_extra) + p_dec->fmt_in.i_extra);
         *(p_extra++) = kp.nbytes >> 8;
         *(p_extra++) = kp.nbytes & 0xFF;
@@ -624,8 +624,8 @@ static int ProcessHeaders( decoder_t *p_dec )
     else
     {
         p_dec->fmt_out.i_extra = p_dec->fmt_in.i_extra;
-        p_dec->fmt_out.p_extra =
-            realloc( p_dec->fmt_out.p_extra, p_dec->fmt_out.i_extra );
+        p_dec->fmt_out.p_extra = xrealloc( p_dec->fmt_out.p_extra,
+                                                  p_dec->fmt_out.i_extra );
         memcpy( p_dec->fmt_out.p_extra,
                 p_dec->fmt_in.p_extra, p_dec->fmt_out.i_extra );
     }
@@ -645,7 +645,7 @@ static subpicture_t *ProcessPacket( decoder_t *p_dec, kate_packet *p_kp,
     subpicture_t *p_buf = NULL;
 
     /* Date management */
-    if( p_block->i_pts > 0 && p_block->i_pts != p_sys->i_pts )
+    if( p_block->i_pts > VLC_TS_INVALID && p_block->i_pts != p_sys->i_pts )
     {
         p_sys->i_pts = p_block->i_pts;
     }
@@ -852,7 +852,7 @@ static void PostprocessTigerImage( plane_t *p_plane, unsigned int i_width )
             if( a )
             {
 #ifdef WORDS_BIGENDIAN
-                uint8_t tmp = pixel[2];
+                uint8_t tmp = p_pixel[2];
                 p_pixel[0] = p_pixel[3] * 255 / a;
                 p_pixel[3] = a;
                 p_pixel[2] = p_pixel[1] * 255 / a;
@@ -1482,8 +1482,7 @@ static void DecSysRelease( decoder_sys_t *p_sys )
 #ifdef HAVE_TIGER
     if( p_sys->p_tr )
         tiger_renderer_destroy( p_sys->p_tr );
-    if( p_sys->psz_tiger_default_font_desc )
-        free( p_sys->psz_tiger_default_font_desc );
+    free( p_sys->psz_tiger_default_font_desc );
 #endif
 
     if (p_sys->b_ready)