[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48548] branches/soc-2011-tomato: Tomato: fixed crash caused by interaction between color management and

Sergey Sharybin sergey.vfx at gmail.com
Tue Jul 3 18:00:59 CEST 2012


Revision: 48548
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48548
Author:   nazgul
Date:     2012-07-03 16:00:57 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
Tomato: fixed crash caused by interaction between color management and
movie clip caches resulting in some unchecked NULL pointers.

Probably it'll be better to separate memory limitors for cache and
clips or double-check priority functions are fine to deal with
such cases.

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/memutil/MEM_CacheLimiter.h
    branches/soc-2011-tomato/source/blender/imbuf/intern/moviecache.c

Modified: branches/soc-2011-tomato/intern/memutil/MEM_CacheLimiter.h
===================================================================
--- branches/soc-2011-tomato/intern/memutil/MEM_CacheLimiter.h	2012-07-03 15:46:23 UTC (rev 48547)
+++ branches/soc-2011-tomato/intern/memutil/MEM_CacheLimiter.h	2012-07-03 16:00:57 UTC (rev 48548)
@@ -254,7 +254,8 @@
 			MEM_CacheElementPtr elem = *it;
 			int priority;
 
-			priority = i;
+			/* by default 0 means higherst priority element */
+			priority = queue.size() - i - 1;
 
 			if (getItemPriority) {
 				priority = getItemPriority(elem->get()->get_data(), priority);

Modified: branches/soc-2011-tomato/source/blender/imbuf/intern/moviecache.c
===================================================================
--- branches/soc-2011-tomato/source/blender/imbuf/intern/moviecache.c	2012-07-03 15:46:23 UTC (rev 48547)
+++ branches/soc-2011-tomato/source/blender/imbuf/intern/moviecache.c	2012-07-03 16:00:57 UTC (rev 48548)
@@ -219,6 +219,14 @@
 	if (!cache->getitempriorityfp)
 		return default_priority;
 
+	if (!cache->last_userkey) {
+		/* happens when cache was overflow when adding element to one cache
+		 * and elements from other cache are being measured as well
+		 */
+
+		return default_priority;
+	}
+
 	return cache->getitempriorityfp(cache->last_userkey, item->priority_data);
 }
 




More information about the Bf-blender-cvs mailing list