diff --git a/CMakeLists.txt b/CMakeLists.txt index 163cba32e..029ed955f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -932,6 +932,12 @@ if(BUILD_TESTING) endif() # WinPR +# We want to control the winpr assert for the whole project +option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON) +if (WITH_VERBOSE_WINPR_ASSERT) + add_definitions(-DWITH_VERBOSE_WINPR_ASSERT) +endif() + if (FREERDP_UNIFIED_BUILD) add_subdirectory(winpr) if (WITH_WAYLAND) @@ -946,12 +952,6 @@ if (FREERDP_UNIFIED_BUILD) else() find_package(WinPR 3 REQUIRED) include_directories(${WinPR_INCLUDE_DIR}) - - # We want to control the winpr assert for the whole project - option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON) - if (WITH_VERBOSE_WINPR_ASSERT) - add_definitions(-DWITH_VERBOSE_WINPR_ASSERT) - endif() endif() # Include directories diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index 44872ebb4..b4c72f236 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -2691,8 +2691,8 @@ int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, WINPR_ASSERT(rect->x % 64 == 0); WINPR_ASSERT(rect->y % 64 == 0); - WINPR_ASSERT(rect->width % 64 == 0); - WINPR_ASSERT(rect->height % 64 == 0); + WINPR_ASSERT(rect->width <= 64); + WINPR_ASSERT(rect->height <= 64); } } else @@ -2717,8 +2717,8 @@ int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, WINPR_ASSERT(r->x % 64 == 0); WINPR_ASSERT(r->y % 64 == 0); - WINPR_ASSERT(r->width % 64 == 0); - WINPR_ASSERT(r->height % 64 == 0); + WINPR_ASSERT(r->width <= 64); + WINPR_ASSERT(r->height <= 64); } } s = progressive->buffer; diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index 60a3138b2..52600db3b 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -330,7 +330,7 @@ static void test_peer_draw_icon(freerdp_peer* client, UINT32 x, UINT32 y) WINPR_ASSERT(client); context = (testPeerContext*)client->context; WINPR_ASSERT(context); - WINPR_ASSERT(context->update); + WINPR_ASSERT(client->update); if (client->update->dump_rfx) return; diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index 673b83bb9..4c8acff1c 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -118,7 +118,7 @@ static INLINE BOOL shadow_client_rdpgfx_reset_graphic(rdpShadowClient* client) rdpSettings* settings; WINPR_ASSERT(client); - WINPR_ASSERT(client->context); + WINPR_ASSERT(client->rdpgfx); context = client->rdpgfx; WINPR_ASSERT(context); @@ -292,7 +292,6 @@ static INLINE void shadow_client_mark_invalid(rdpShadowClient* client, UINT32 nu rdpSettings* settings; WINPR_ASSERT(client); - WINPR_ASSERT(client->context); WINPR_ASSERT(rects || (numRects == 0)); settings = client->context.settings;