Merge branch 'fix_privacy_mask_segfaults' into mmap_fd_gt_3
This commit is contained in:
commit
e70d49b033
|
@ -337,7 +337,8 @@ Monitor::Monitor(
|
||||||
n_zones( p_n_zones ),
|
n_zones( p_n_zones ),
|
||||||
zones( p_zones ),
|
zones( p_zones ),
|
||||||
timestamps( 0 ),
|
timestamps( 0 ),
|
||||||
images( 0 )
|
images( 0 ),
|
||||||
|
privacy_bitmask( NULL )
|
||||||
{
|
{
|
||||||
strncpy( name, p_name, sizeof(name) );
|
strncpy( name, p_name, sizeof(name) );
|
||||||
|
|
||||||
|
@ -698,11 +699,13 @@ void Monitor::AddZones( int p_n_zones, Zone *p_zones[] )
|
||||||
|
|
||||||
void Monitor::AddPrivacyBitmask( Zone *p_zones[] )
|
void Monitor::AddPrivacyBitmask( Zone *p_zones[] )
|
||||||
{
|
{
|
||||||
|
if ( privacy_bitmask )
|
||||||
delete[] privacy_bitmask;
|
delete[] privacy_bitmask;
|
||||||
privacy_bitmask = NULL;
|
privacy_bitmask = NULL;
|
||||||
Image *privacy_image = NULL;
|
Image *privacy_image = NULL;
|
||||||
|
|
||||||
for ( int i = 0; i < n_zones; i++ )
|
for ( int i = 0; i < n_zones; i++ )
|
||||||
|
{
|
||||||
if ( p_zones[i]->IsPrivacy() )
|
if ( p_zones[i]->IsPrivacy() )
|
||||||
{
|
{
|
||||||
if ( !privacy_image )
|
if ( !privacy_image )
|
||||||
|
@ -713,6 +716,7 @@ void Monitor::AddPrivacyBitmask( Zone *p_zones[] )
|
||||||
privacy_image->Fill( 0xff, p_zones[i]->GetPolygon() );
|
privacy_image->Fill( 0xff, p_zones[i]->GetPolygon() );
|
||||||
privacy_image->Outline( 0xff, p_zones[i]->GetPolygon() );
|
privacy_image->Outline( 0xff, p_zones[i]->GetPolygon() );
|
||||||
}
|
}
|
||||||
|
} // end foreach zone
|
||||||
if ( privacy_image )
|
if ( privacy_image )
|
||||||
privacy_bitmask = privacy_image->Buffer();
|
privacy_bitmask = privacy_image->Buffer();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue