summaryrefslogtreecommitdiff
path: root/libstagefrighthw
diff options
context:
space:
mode:
authorArun Menon <avmenon@codeaurora.org>2014-06-20 20:07:53 -0700
committerArun Menon <avmenon@codeaurora.org>2014-06-26 09:29:05 -0700
commit8da730aff9ad27d734c30fd05a52ead7b1955cae (patch)
treec51ef213934df32811f8d17caf96b17bd8446056 /libstagefrighthw
parentf49889d8dc4e7bbd31dc8f46e4bed188ad93173f (diff)
downloadmedia-8da730aff9ad27d734c30fd05a52ead7b1955cae.tar.gz
mm-video-v4l2: Fix static analyzer issues
Add error handling for issues reported by static analyzer. Change-Id: I93894ca70736e423d91f216de4db42fd34adae8d
Diffstat (limited to 'libstagefrighthw')
-rwxr-xr-xlibstagefrighthw/QComOMXPlugin.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libstagefrighthw/QComOMXPlugin.cpp b/libstagefrighthw/QComOMXPlugin.cpp
index 9446dcf6..7f8933ba 100755
--- a/libstagefrighthw/QComOMXPlugin.cpp
+++ b/libstagefrighthw/QComOMXPlugin.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 The Android Open Source Project
+ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,7 +49,12 @@ QComOMXPlugin::QComOMXPlugin()
(GetRolesOfComponentFunc)dlsym(
mLibHandle, "OMX_GetRolesOfComponent");
- (*mInit)();
+ if (!mInit || !mDeinit || !mComponentNameEnum || !mGetHandle ||
+ !mFreeHandle || !mGetRolesOfComponentHandle) {
+ dlclose(mLibHandle);
+ mLibHandle = NULL;
+ } else
+ (*mInit)();
}
}