summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gst/subparse/gstsubparse.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c
index fd1473345..c8acc0650 100644
--- a/gst/subparse/gstsubparse.c
+++ b/gst/subparse/gstsubparse.c
@@ -982,11 +982,17 @@ parse_subrip (ParserState * state, const gchar * line)
switch (state->state) {
case 0:{
char *endptr;
+ guint64 id;
/* looking for a single integer as a Cue ID, but we
* don't actually use it */
- (void) strtol (line, &endptr, 10);
- if (endptr != line && *endptr == '\0')
+ errno = 0;
+ id = g_ascii_strtoull (line, &endptr, 10);
+ if (id == G_MAXUINT64 && errno == ERANGE)
+ state->state = 1;
+ else if (id == 0 && errno == EINVAL)
+ state->state = 1;
+ else if (endptr != line && *endptr == '\0')
state->state = 1;
return NULL;
}