From 8c272923736861cccfae0befebf09760baf54bf1 Mon Sep 17 00:00:00 2001
From: Lukasz Marek <lukasz.m.luki2@gmail.com>
Date: Thu, 3 Apr 2014 14:44:43 +0200
Subject: [PATCH] lavu/opt: dont crash on freeing NULL AVOptionRanges

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 libavutil/opt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index cffa5a6a247..ea2a5b7d484 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);
-- 
GitLab