summaryrefslogtreecommitdiff
path: root/src/android/jpeg/post_processor_jpeg.cpp
diff options
context:
space:
mode:
authorUmang Jain <umang.jain@ideasonboard.com>2021-10-26 12:51:43 +0530
committerUmang Jain <umang.jain@ideasonboard.com>2021-10-26 16:11:17 +0530
commited9eb080e9d723292596ee4d335e101b0ae75278 (patch)
treedb5ecfdf575a8f79d25e41f848b3e91b731c1cd3 /src/android/jpeg/post_processor_jpeg.cpp
parentd559905c5f4e844c742aaf31c56883e60f15699a (diff)
android: post_processor_jpeg: Replace encoder_ nullptr check
Instead of simply returning if encoder_ is nullptr, fail hard via an assertion. It is quite unlikely that encoder_ could only be null as a result of a fatal bug in the code, so be loud about the failure. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/android/jpeg/post_processor_jpeg.cpp')
-rw-r--r--src/android/jpeg/post_processor_jpeg.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
index 699576ef..49483836 100644
--- a/src/android/jpeg/post_processor_jpeg.cpp
+++ b/src/android/jpeg/post_processor_jpeg.cpp
@@ -102,9 +102,7 @@ int PostProcessorJpeg::process(const FrameBuffer &source,
CameraBuffer *destination,
Camera3RequestDescriptor *request)
{
- if (!encoder_)
- return 0;
-
+ ASSERT(encoder_);
ASSERT(destination->numPlanes() == 1);
const CameraMetadata &requestMetadata = request->settings_;