Skip to content

Commit 30ac5e5

Browse files
committed
fixed #1897
1 parent a69b567 commit 30ac5e5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/filters/load_text.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ char *gf_text_get_utf8_line(char *szLine, u32 lineSize, FILE *txt_in, s32 unicod
255255
{
256256
u32 i, j, len;
257257
char *sOK;
258-
char szLineConv[1024];
258+
char szLineConv[2048];
259259
unsigned short *sptr;
260260

261261
memset(szLine, 0, sizeof(char)*lineSize);
@@ -328,7 +328,7 @@ char *gf_text_get_utf8_line(char *szLine, u32 lineSize, FILE *txt_in, s32 unicod
328328
}
329329
}
330330
sptr = (u16 *)szLine;
331-
i = (u32) gf_utf8_wcstombs(szLineConv, 1024, (const unsigned short **) &sptr);
331+
i = (u32) gf_utf8_wcstombs(szLineConv, 2048, (const unsigned short **) &sptr);
332332
szLineConv[i] = 0;
333333
strcpy(szLine, szLineConv);
334334
/*this is ugly indeed: since input is UTF16-LE, there are many chances the gf_fgets never reads the \0 after a \n*/
@@ -2338,6 +2338,8 @@ static GF_Err gf_text_process_sub(GF_Filter *filter, GF_TXTIn *ctx)
23382338
while (szLine[i+1] && szLine[i+1]!='}') {
23392339
szTime[i] = szLine[i+1];
23402340
i++;
2341+
if (i>=19)
2342+
break;
23412343
}
23422344
szTime[i] = 0;
23432345
ctx->start = atoi(szTime);

0 commit comments

Comments
 (0)