Commit 8a570321 authored by bbcallen's avatar bbcallen Committed by Hugo Beauzée-Luyssen

hls: m3u8 parser should pass 0xD at line end

Signed-off-by: default avatarHugo Beauzée-Luyssen <beauze.h@gmail.com>
parent 411132d9
...@@ -1808,22 +1808,28 @@ static char *ReadLine(uint8_t *buffer, uint8_t **pos, const size_t len) ...@@ -1808,22 +1808,28 @@ static char *ReadLine(uint8_t *buffer, uint8_t **pos, const size_t len)
while (p < end) while (p < end)
{ {
if ((*p == '\n') || (*p == '\0')) if ((*p == '\r') || (*p == '\n') || (*p == '\0'))
break; break;
p++; p++;
} }
/* copy line excluding \n or \0 */ /* copy line excluding \r \n or \0 */
line = strndup((char *)begin, p - begin); line = strndup((char *)begin, p - begin);
while ((*p == '\r') || (*p == '\n') || (*p == '\0'))
{
if (*p == '\0') if (*p == '\0')
{
*pos = end; *pos = end;
break;
}
else else
{ {
/* next pass start after \n */ /* next pass start after \r and \n */
p++; p++;
*pos = p; *pos = p;
} }
}
return line; return line;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment