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,21 +1808,27 @@ static char *ReadLine(uint8_t *buffer, uint8_t **pos, const size_t len) ...@@ -1808,21 +1808,27 @@ 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);
if (*p == '\0') while ((*p == '\r') || (*p == '\n') || (*p == '\0'))
*pos = end;
else
{ {
/* next pass start after \n */ if (*p == '\0')
p++; {
*pos = p; *pos = end;
break;
}
else
{
/* next pass start after \r and \n */
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