[MPlayer-cvslog] r18861 - in trunk: mplayer.c subreader.c

reynaldo subversion at mplayerhq.hu
Fri Jun 30 06:09:29 CEST 2006


Author: reynaldo
Date: Fri Jun 30 06:09:29 2006
New Revision: 18861

Modified:
   trunk/mplayer.c
   trunk/subreader.c

Log:
more sizeof(char) fun

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Fri Jun 30 06:09:29 2006
@@ -2993,7 +2993,7 @@
         mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,vobsub_name);
     }else if(sub_auto && filename && (strlen(filename)>=5)){
       /* try to autodetect vobsub from movie filename ::atmos */
-      char *buf = malloc((strlen(filename)-3) * sizeof(char)),*psub;
+      char *buf = malloc((strlen(filename)-3)),*psub;
       memset(buf,0,strlen(filename)-3); // make sure string is terminated
       strncpy(buf, filename, strlen(filename)-4); 
       vo_vobsub=vobsub_open(buf,spudec_ifo,0,&vo_spudec);
@@ -3152,7 +3152,7 @@
     
     if (filename && !strcmp(mp_basename(playlist_entry),playlist_entry)) // add reference path of current file
     {
-      temp=malloc((strlen(filename)-strlen(mp_basename(filename))+strlen(playlist_entry)+1)*sizeof(char));
+      temp=malloc((strlen(filename)-strlen(mp_basename(filename))+strlen(playlist_entry)+1));
       if (temp)
       {
 	strncpy(temp, filename, strlen(filename)-strlen(mp_basename(filename)));

Modified: trunk/subreader.c
==============================================================================
--- trunk/subreader.c	(original)
+++ trunk/subreader.c	Fri Jun 30 06:09:29 2006
@@ -1218,7 +1218,7 @@
     if(log2vis) {
       len = fribidi_remove_bidi_marks (visual, len, NULL, NULL,
 				       NULL);
-      if((op = (char*)malloc(sizeof(char)*(max(2*orig_len,2*len) + 1))) == NULL) {
+      if((op = (char*)malloc((max(2*orig_len,2*len) + 1))) == NULL) {
 	mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: error allocating mem.\n");
 	l++;
 	break;	
@@ -1314,7 +1314,7 @@
     char *detected_sub_cp = NULL;
     int i;
 
-    buffer = (unsigned char*)malloc(MAX_GUESS_BUFFER_SIZE*sizeof(char));
+    buffer = (unsigned char*)malloc(MAX_GUESS_BUFFER_SIZE);
     buflen = stream_read(st,buffer, MAX_GUESS_BUFFER_SIZE);
 
     languages = enca_get_languages(&langcnt);



More information about the MPlayer-cvslog mailing list