[libcamera-devel,v7,2/7] android: post_processor_jpeg: Replace encoder_ nullptr check
diff mbox series

Message ID 20211025203833.122460-3-umang.jain@ideasonboard.com
State Superseded
Delegated to: Umang Jain
Headers show
  • Async Post Processor
Related show

Commit Message

Umang Jain Oct. 25, 2021, 8:38 p.m. UTC
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>
 src/android/jpeg/post_processor_jpeg.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff mbox series

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_;