diff --git a/libavformat/utils.c b/libavformat/utils.c index 3302651af2..4888aafc29 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -5000,7 +5000,7 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf, key_len = ptr - key; callback_get_buf(context, key, key_len, &dest, &dest_len); - dest_end = dest + dest_len - 1; + dest_end = dest ? dest + dest_len - 1 : NULL; if (*ptr == '\"') { ptr++;