[Mplayer-cvslog] CVS: main subreader.c,1.117,1.118
Alex Beregszaszi
alex at mplayerhq.hu
Sun Aug 10 17:15:10 CEST 2003
Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv3243
Modified Files:
subreader.c
Log Message:
10l
Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -r1.117 -r1.118
--- subreader.c 9 Aug 2003 16:30:55 -0000 1.117
+++ subreader.c 10 Aug 2003 15:14:47 -0000 1.118
@@ -1028,8 +1028,9 @@
#endif
#ifdef USE_FRIBIDI
-#define ALLOCATE(tp,ln) ((tp *) malloc (sizeof (tp) * (ln)))
+#ifndef max
#define max(a,b) (((a)>(b))?(a):(b))
+#endif
subtitle* sub_fribidi (subtitle *sub, int sub_utf8)
{
FriBidiChar logical[LINE_LEN+1], visual[LINE_LEN+1]; // Hopefully these two won't smash the stack
@@ -1063,6 +1064,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 = ALLOCATE(char,(max(2*orig_len,2*len) + 1))) == NULL) {
mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: error allocating mem.\n");
l++;
@@ -1732,7 +1734,7 @@
if (prio) {
prio += prio;
#ifdef USE_ICONV
- if (i<3) // prefer UTF-8 coded
+ if (sub_cp) // prefer UTF-8 coded
prio++;
#endif
sprintf(tmpresult, "%s%s", j == 0 ? f_dir : path, de->d_name);
More information about the MPlayer-cvslog
mailing list