Some options used for "expert" x264 setup were removed from FFmpeg 0.11
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 18 Jun 2012 15:42:23 +0000 (15:42 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 18 Jun 2012 15:42:23 +0000 (15:42 +0000)
Prevent crashes in cases when option can't be found.

source/blender/blenkernel/intern/writeffmpeg.c

index 532bd25..b310163 100644 (file)
@@ -1206,7 +1206,7 @@ int BKE_ffmpeg_property_add_string(RenderData *rd, const char *type, const char
        char name_[128];
        char *name;
        char *param;
-       IDProperty *prop;
+       IDProperty *prop = NULL;
        
        avcodec_get_context_defaults(&c);
 
@@ -1234,9 +1234,11 @@ int BKE_ffmpeg_property_add_string(RenderData *rd, const char *type, const char
        }
        if (param && o->type != FF_OPT_TYPE_CONST && o->unit) {
                p = my_av_find_opt(&c, param, o->unit, 0, 0);   
-               prop = BKE_ffmpeg_property_add(rd,
-                                              (char *) type, p - c.av_class->option,
-                                              o - c.av_class->option);
+               if (p) {
+                       prop = BKE_ffmpeg_property_add(rd,
+                                                      (char *) type, p - c.av_class->option,
+                                                      o - c.av_class->option);
+               }
        }
        else {
                prop = BKE_ffmpeg_property_add(rd,