diff options
author | Arun Menon <avmenon@codeaurora.org> | 2014-06-20 20:07:53 -0700 |
---|---|---|
committer | Arun Menon <avmenon@codeaurora.org> | 2014-06-26 09:29:05 -0700 |
commit | 8da730aff9ad27d734c30fd05a52ead7b1955cae (patch) | |
tree | c51ef213934df32811f8d17caf96b17bd8446056 /libstagefrighthw | |
parent | f49889d8dc4e7bbd31dc8f46e4bed188ad93173f (diff) | |
download | media-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-x | libstagefrighthw/QComOMXPlugin.cpp | 8 |
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)(); } } |