Fix wxBitmap::GetRawData() in wxQt
This method used to return a dangling pointer to a temporary buffer, which resulted in a crash when using it, e.g. in the unit test. Fix this by keeping a QImage as a member in wxBitmapRefData, so that the pointer to its data remain valid until UngetRawData() is called. Also check that GetRawData() returns a non-null pointer in the test. Closes https://github.com/wxWidgets/wxWidgets/pull/1067
This commit is contained in:
committed by
Vadim Zeitlin
parent
013c6a6b6a
commit
db15e99884
@@ -126,6 +126,7 @@ void BitmapTestCase::OverlappingBlit()
|
||||
if ( m_bmp.GetDepth() == 32 )
|
||||
{
|
||||
wxAlphaPixelData npd( m_bmp );
|
||||
CPPUNIT_ASSERT_MESSAGE( "Expected raw pixels to not be NULL", npd );
|
||||
wxAlphaPixelData::Iterator it( npd );
|
||||
|
||||
ASSERT_EQUAL_RGB( it, 255, 0, 0 );
|
||||
|
Reference in New Issue
Block a user