Skip to content
Permalink
Browse files Browse the repository at this point in the history
check error code on call to gf_utf8_wcstombs (#1177)
  • Loading branch information
aureliendavid committed Dec 13, 2018
1 parent 4e318a2 commit 4c13608
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/media_tools/text_import.c
Expand Up @@ -269,6 +269,8 @@ char *gf_text_get_utf8_line(char *szLine, u32 lineSize, FILE *txt_in, s32 unicod
}
sptr = (u16 *)szLine;
i = (u32) gf_utf8_wcstombs(szLineConv, 1024, (const unsigned short **) &sptr);
if (i >= (u32)ARRAY_LENGTH(szLineConv))
return NULL;
szLineConv[i] = 0;
strcpy(szLine, szLineConv);
/*this is ugly indeed: since input is UTF16-LE, there are many chances the fgets never reads the \0 after a \n*/
Expand Down

0 comments on commit 4c13608

Please sign in to comment.