Fix crash showing footage information for non-animation movie clips
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 18 Dec 2018 11:06:16 +0000 (12:06 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 18 Dec 2018 11:06:40 +0000 (12:06 +0100)
source/blender/editors/space_clip/clip_buttons.c

index 79e632ce1c1392ee38c3bcd338d512a3aed2b50f..ebe8e802a3786acdbf453577efd644e95b0f5403 100644 (file)
@@ -535,10 +535,14 @@ void uiTemplateMovieclipInformation(uiLayout *layout, PointerRNA *ptr, const cha
                                ofs += BLI_strncpy_rlen(str + ofs, IFACE_(", RGB byte"), sizeof(str) - ofs);
                }
 
-               short frs_sec;
-               float frs_sec_base;
-               if (IMB_anim_get_fps(clip->anim, &frs_sec, &frs_sec_base, true)) {
-                       ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs, IFACE_(", %.2f fps"), (float)frs_sec / frs_sec_base);
+               if (clip->anim != NULL) {
+                       short frs_sec;
+                       float frs_sec_base;
+                       if (IMB_anim_get_fps(clip->anim, &frs_sec, &frs_sec_base, true)) {
+                               ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs,
+                                                   IFACE_(", %.2f fps"),
+                                                   (float)frs_sec / frs_sec_base);
+                       }
                }
        }
        else {