Fix memory corruption in heightForWidth cache
Overflowing q_firstCachedHfw caused memory to be overwritten before q_cachedHfws. Change-Id: Ibbcc72380f426550cc0569a05c54cd1acd878b33 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>bb10
parent
18a1cfaba3
commit
c067083057
|
|
@ -839,7 +839,7 @@ int QWidgetItemV2::heightForWidth(int width) const
|
|||
const QSize &size = q_cachedHfws[offset % HfwCacheMaxSize];
|
||||
if (size.width() == width) {
|
||||
if (q_hfwCacheSize == HfwCacheMaxSize)
|
||||
q_firstCachedHfw = offset;
|
||||
q_firstCachedHfw = offset % HfwCacheMaxSize;
|
||||
return size.height();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue