Fixes CHECK < which should be CHECK_LE
It still doesn't work with realvnc, which just displays a black screen,
but that's never been a supported client. tightvncviewer with raw
encoding works.
Bug: 115678896
Test: local tightvnc with raw, local realvnc with raw (black screen)
Change-Id: Ia07ad81f3fd5ec095da6b5135913857f63105ebd
diff --git a/host/frontend/vnc_server/vnc_client_connection.cpp b/host/frontend/vnc_server/vnc_client_connection.cpp
index d680a8f..25b007d 100644
--- a/host/frontend/vnc_server/vnc_client_connection.cpp
+++ b/host/frontend/vnc_server/vnc_client_connection.cpp
@@ -320,7 +320,7 @@
auto init_size = fbu.size();
fbu.insert(fbu.end(), stripe.raw_data.begin(), stripe.raw_data.end());
for (size_t i = init_size; i < fbu.size(); i += sizeof(Pixel)) {
- CHECK((i + sizeof(Pixel)) < fbu.size());
+ CHECK_LE(i + sizeof(Pixel), fbu.size());
Pixel raw_pixel{};
std::memcpy(&raw_pixel, &fbu[i], sizeof raw_pixel);
auto red = RedVal(raw_pixel);
@@ -336,7 +336,6 @@
std::swap(p[0], p[3]);
std::swap(p[1], p[2]);
}
- CHECK(i + sizeof pixel <= fbu.size());
std::memcpy(&fbu[i], &pixel, sizeof pixel);
}
}