From 6003de2fe44e4e019580bfb42f526b8310fbb610 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 9 Oct 2006 18:58:06 +0000 Subject: [PATCH] check that the bitmap is valid before getting its size to avoid asserts git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/animateg.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/generic/animateg.cpp b/src/generic/animateg.cpp index 2ab49659dd..90cb3cae6a 100644 --- a/src/generic/animateg.cpp +++ b/src/generic/animateg.cpp @@ -389,9 +389,11 @@ void wxAnimationCtrl::RebuildBackingStoreUpToFrame(size_t frame) int w = wxMin(sz.GetWidth(), winsz.GetWidth()); int h = wxMin(sz.GetHeight(), winsz.GetHeight()); - if (m_backingStore.GetWidth() < w || - m_backingStore.GetHeight() < h) + if ( !m_backingStore.Ok() || + m_backingStore.GetWidth() < w || m_backingStore.GetHeight() < h ) + { m_backingStore.Create(w, h); + } wxMemoryDC dc; dc.SelectObject(m_backingStore);