[FFmpeg-devel] [PATCH] lavu/opt: dont crash on freeing NULL AVOptionRanges

Lukasz Marek lukasz.m.luki2 at gmail.com
Thu Apr 3 14:44:43 CEST 2014


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

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



More information about the ffmpeg-devel mailing list