Message ID | 20200415054503.13108-3-email@uajain.com |
---|---|
State | Rejected |
Delegated to: | Umang Jain |
Headers | show |
Series |
|
Related | show |
diff --git a/test/v4l2_videodevice/buffer_cache.cpp b/test/v4l2_videodevice/buffer_cache.cpp index d730e75..1870249 100644 --- a/test/v4l2_videodevice/buffer_cache.cpp +++ b/test/v4l2_videodevice/buffer_cache.cpp @@ -90,6 +90,11 @@ public: /* Pick a hot buffer at random and store its index. */ int hotBuffer = dist(generator_); int hotIndex = cache->get(*buffers[hotBuffer].get()); + if (hotIndex < 0) { + std::cout << "Failed lookup from cache" << std::endl; + return TestFail; + } + cache->put(hotIndex); /*
Pointed out by Coverity DefectId=279090 Signed-off-by: Umang Jain <email@uajain.com> --- test/v4l2_videodevice/buffer_cache.cpp | 5 +++++ 1 file changed, 5 insertions(+)