diff --git a/libavutil/opt.c b/libavutil/opt.c index cffa5a6a24..ea2a5b7d48 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1608,6 +1608,9 @@ void av_opt_freep_ranges(AVOptionRanges **rangesp) int i; AVOptionRanges *ranges = *rangesp; + if (!ranges) + return; + for (i = 0; i < ranges->nb_ranges * ranges->nb_components; i++) { AVOptionRange *range = ranges->range[i]; av_freep(&range->str);