Commit fc50e57a authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

hls: Fix parse_SegmentInformation error checking.

parent 4f96ae4a
......@@ -34,6 +34,7 @@
#include <vlc_plugin.h>
#include <assert.h>
#include <errno.h>
#include <gcrypt.h>
#include <vlc_threads.h>
......@@ -576,8 +577,9 @@ static int parse_SegmentInformation(hls_stream_t *hls, char *p_read, int *durati
char *endptr;
if (hls->version < 3)
{
errno = 0;
value = strtol(token, &endptr, 10);
if (token == endptr)
if (token == endptr || errno == ERANGE )
{
*duration = -1;
return VLC_EGENERIC;
......@@ -586,8 +588,9 @@ static int parse_SegmentInformation(hls_stream_t *hls, char *p_read, int *durati
}
else
{
errno = 0;
double d = strtof(token, &endptr);
if (token == endptr)
if (token == endptr || errno == ERANGE )
{
*duration = -1;
return VLC_EGENERIC;
......
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