Skip to content

Commit

Permalink
agg_path_storage.h: avoid warning about nullptr deref (CID 1175262 an…
Browse files Browse the repository at this point in the history
…d 1175261)
  • Loading branch information
rouault committed May 23, 2021
1 parent 47807cb commit b4f5819
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions renderers/agg/include/agg_path_storage.h
Expand Up @@ -329,6 +329,7 @@ namespace mapserver
pod_allocator<T>::allocate(block_size * 2 +
block_size / (sizeof(T) / sizeof(unsigned char)));

assert(m_cmd_blocks);
m_cmd_blocks[nb] =
(unsigned char*)(m_coord_blocks[nb] + block_size * 2);

Expand All @@ -344,6 +345,8 @@ namespace mapserver
{
allocate_block(nb);
}
assert(m_coord_blocks);
assert(m_cmd_blocks);
*xy_ptr = m_coord_blocks[nb] + ((m_total_vertices & block_mask) << 1);
return m_cmd_blocks[nb] + (m_total_vertices & block_mask);
}
Expand Down

0 comments on commit b4f5819

Please sign in to comment.