diff --git a/libavformat/utils.c b/libavformat/utils.c index be3e776291..a33f8f956e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -4951,7 +4951,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++;