[Bf-blender-cvs] [a68f5456e48] blender-v2.93-release: Fix: VSE timecodes being used even when turned off.
Sebastian Parborg
noreply at git.blender.org
Wed Jun 30 09:47:16 CEST 2021
Commit: a68f5456e48b80825f1513b87c37463e7ad6cc3f
Author: Sebastian Parborg
Date: Wed Jun 9 13:56:51 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rBa68f5456e48b80825f1513b87c37463e7ad6cc3f
Fix: VSE timecodes being used even when turned off.
Reviewed By: Richard Antalik
Differential Revision: http://developer.blender.org/D11567
===================================================================
M source/blender/imbuf/intern/indexer.c
===================================================================
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index 7cbdf7fadd1..e1995bf7c3e 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -319,8 +319,7 @@ int IMB_proxy_size_to_array_index(IMB_Proxy_Size pr_size)
{
switch (pr_size) {
case IMB_PROXY_NONE:
- /* if we got here, something is broken anyways, so sane defaults... */
- return 0;
+ return -1;
case IMB_PROXY_25:
return 0;
case IMB_PROXY_50:
@@ -330,16 +329,16 @@ int IMB_proxy_size_to_array_index(IMB_Proxy_Size pr_size)
case IMB_PROXY_100:
return 3;
default:
- return 0;
+ BLI_assert(!"Unhandled proxy size enum!");
+ return -1;
}
}
int IMB_timecode_to_array_index(IMB_Timecode_Type tc)
{
switch (tc) {
- case IMB_TC_NONE: /* if we got here, something is broken anyways,
- * so sane defaults... */
- return 0;
+ case IMB_TC_NONE:
+ return -1;
case IMB_TC_RECORD_RUN:
return 0;
case IMB_TC_FREE_RUN:
@@ -349,7 +348,8 @@ int IMB_timecode_to_array_index(IMB_Timecode_Type tc)
case IMB_TC_RECORD_RUN_NO_GAPS:
return 3;
default:
- return 0;
+ BLI_assert(!"Unhandled timecode type enum!");
+ return -1;
}
}
@@ -385,6 +385,8 @@ static bool get_proxy_filename(struct anim *anim,
char index_dir[FILE_MAXDIR];
int i = IMB_proxy_size_to_array_index(preview_size);
+ BLI_assert(i >= 0);
+
char proxy_name[256];
char stream_suffix[20];
const char *name = (temp) ? "proxy_%d%s_part.avi" : "proxy_%d%s.avi";
@@ -416,6 +418,9 @@ static void get_tc_filename(struct anim *anim, IMB_Timecode_Type tc, char *fname
{
char index_dir[FILE_MAXDIR];
int i = IMB_timecode_to_array_index(tc);
+
+ BLI_assert(i >= 0);
+
const char *index_names[] = {
"record_run%s%s.blen_tc",
"free_run%s%s.blen_tc",
@@ -1390,6 +1395,10 @@ struct anim *IMB_anim_open_proxy(struct anim *anim, IMB_Proxy_Size preview_size)
char fname[FILE_MAX];
int i = IMB_proxy_size_to_array_index(preview_size);
+ if (i < 0) {
+ return NULL;
+ }
+
if (anim->proxy_anim[i]) {
return anim->proxy_anim[i];
}
@@ -1413,6 +1422,10 @@ struct anim_index *IMB_anim_open_index(struct anim *anim, IMB_Timecode_Type tc)
char fname[FILE_MAX];
int i = IMB_timecode_to_array_index(tc);
+ if (i < 0) {
+ return NULL;
+ }
+
if (anim->curr_idx[i]) {
return anim->curr_idx[i];
}
More information about the Bf-blender-cvs
mailing list