lavu/opt: dont crash on freeing NULL AVOptionRanges
authorLukasz Marek <lukasz.m.luki2@gmail.com>
Thu, 3 Apr 2014 12:44:43 +0000 (14:44 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 3 Apr 2014 17:05:19 +0000 (19:05 +0200)
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/opt.c

index cffa5a6..ea2a5b7 100644 (file)
@@ -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);