summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gst/subparse/samiparse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gst/subparse/samiparse.c b/gst/subparse/samiparse.c
index 517e959a9..377c6d730 100644
--- a/gst/subparse/samiparse.c
+++ b/gst/subparse/samiparse.c
@@ -504,7 +504,8 @@ html_context_handle_element (HtmlContext * ctxt,
}
length = strlen (attr_value);
- if (attr_value[length - 1] == '"' || attr_value[length - 1] == '\'') {
+ if (length > 0 && (attr_value[length - 1] == '"'
+ || attr_value[length - 1] == '\'')) {
attr_value[length - 1] = '\0';
}