From 026a78b4e6fa1e7beb335d43ffb86f127a218fcb Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 25 May 2006 07:26:32 +0000 Subject: [PATCH] add a couple of asserts to note conditions that must hold true (and currently do from reading the code) that confused coverity c.f. CIDs 2215 and 2207 svn path=/branches/work/kde4/playground/graphics/okular/; revision=544514 --- ui/painter_agg2/agg_path_storage.h | 4 ++++ ui/painter_agg2/agg_rendering_buffer.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ui/painter_agg2/agg_path_storage.h b/ui/painter_agg2/agg_path_storage.h index 3c584d803..1ebe092c3 100644 --- a/ui/painter_agg2/agg_path_storage.h +++ b/ui/painter_agg2/agg_path_storage.h @@ -16,6 +16,8 @@ #ifndef AGG_PATH_STORAGE_INCLUDED #define AGG_PATH_STORAGE_INCLUDED +#include + #include "agg_basics.h" namespace agg @@ -316,6 +318,8 @@ namespace agg { allocate_block(nb); } + + assert(m_coord_blocks); *xy_ptr = m_coord_blocks[nb] + ((m_total_vertices & block_mask) << 1); return m_cmd_blocks[nb] + (m_total_vertices & block_mask); } diff --git a/ui/painter_agg2/agg_rendering_buffer.h b/ui/painter_agg2/agg_rendering_buffer.h index fff79ded7..23ae6d779 100644 --- a/ui/painter_agg2/agg_rendering_buffer.h +++ b/ui/painter_agg2/agg_rendering_buffer.h @@ -20,6 +20,8 @@ #ifndef AGG_RENDERING_BUFFER_INCLUDED #define AGG_RENDERING_BUFFER_INCLUDED +#include + #include "agg_basics.h" namespace agg @@ -90,6 +92,7 @@ namespace agg T** rows = m_rows; + assert(height == 0 || m_rows); while(height--) { *rows++ = row_ptr;