Skip to content
Snippets Groups Projects
Commit ba9e9414 authored by Cindy Zhou's avatar Cindy Zhou
Browse files

Cfi function attribute for component factory

Declare cfi_canonical_jump_table for codec factory functions to avoid
cfi crashes.

Bug: 158010610
Bug: 173497308
Test: ran atest DecoderConformanceTest, ImageReaderDecoderTest,
VideoDecoderPerfTest, VideoEncoderTest.  Compare the
before and after enabling CFI results since there was a number of tests
that were initially failing.

Change-Id: Iced1b81656534de315779f5c9c6788c5c9c1a068
parent fb22d12f
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,8 @@ c2_status_t V4L2ComponentFactory::createInterface(
} // namespace android
extern "C" ::C2ComponentFactory* CreateCodec2Factory(const char* componentName) {
__attribute__((cfi_canonical_jump_table)) extern "C" ::C2ComponentFactory* CreateCodec2Factory(
const char* componentName) {
ALOGV("%s(%s)", __func__, componentName);
if (!android::V4L2ComponentName::isValid(componentName)) {
......@@ -111,7 +112,8 @@ extern "C" ::C2ComponentFactory* CreateCodec2Factory(const char* componentName)
return new android::V4L2ComponentFactory(componentName, isEncoder);
}
extern "C" void DestroyCodec2Factory(::C2ComponentFactory* factory) {
__attribute__((cfi_canonical_jump_table)) extern "C" void DestroyCodec2Factory(
::C2ComponentFactory* factory) {
ALOGV("%s()", __func__);
delete factory;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment