C2SoftGav1Dec: convert format CHECK to error return
this matches the C2SoftVpxDec change in aosp/1266844
Bug: 188395904
Test: None
Change-Id: I54a7af62899448f19bc2f800be109a876216988c
diff --git a/media/codec2/components/gav1/C2SoftGav1Dec.cpp b/media/codec2/components/gav1/C2SoftGav1Dec.cpp
index ff59490..f857e87 100644
--- a/media/codec2/components/gav1/C2SoftGav1Dec.cpp
+++ b/media/codec2/components/gav1/C2SoftGav1Dec.cpp
@@ -651,8 +651,14 @@
}
}
- CHECK(buffer->image_format == libgav1::kImageFormatYuv420 ||
- buffer->image_format == libgav1::kImageFormatMonochrome400);
+ if (!(buffer->image_format == libgav1::kImageFormatYuv420 ||
+ buffer->image_format == libgav1::kImageFormatMonochrome400)) {
+ ALOGE("image_format %d not supported", buffer->image_format);
+ mSignalledError = true;
+ work->workletsProcessed = 1u;
+ work->result = C2_CORRUPTED;
+ return false;
+ }
const bool isMonochrome =
buffer->image_format == libgav1::kImageFormatMonochrome400;