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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user