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.
This commit is contained in:
Sergey Sharybin
2012-07-03 16:00:57 +00:00
parent 89af953a65
commit 1b556dcb51
2 changed files with 10 additions and 1 deletions

View File

@@ -254,7 +254,8 @@ private:
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);

View File

@@ -219,6 +219,14 @@ static int get_item_priority(void *item_v, int default_priority)
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);
}