Fix virtual camera crash
Caught by the fuzzer
The camera buffer can be zero in the camera capture thread
Add a checking for that
Fix: 195661931
Test: Build evs_virtual_camera_fuzzer and run on the target device
Change-Id: I2c44299ce175948251b34a35d261f43b2931077f
diff --git a/cpp/evs/manager/1.1/VirtualCamera.cpp b/cpp/evs/manager/1.1/VirtualCamera.cpp
index a7e6329..3b0ef95 100644
--- a/cpp/evs/manager/1.1/VirtualCamera.cpp
+++ b/cpp/evs/manager/1.1/VirtualCamera.cpp
@@ -399,6 +399,9 @@
if (pHwCamera == nullptr) {
continue;
}
+ if (mFramesHeld[key].size() == 0) {
+ continue;
+ }
const auto frame = mFramesHeld[key].back();
if (frame.timestamp > lastFrameTimestamp) {