summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSurajit Podder <spodder@codeaurora.org>2017-09-13 17:45:35 +0530
committerArne Coucheron <arco68@gmail.com>2018-02-14 00:17:58 +0100
commitd39a45a6fb4666b22d7599f81a5c3397dd257995 (patch)
tree3ffcd5af173614d7b3553c6554bc6c3e507b5144
parentfa71989c15bdb90c1eaa2c56ca61f344b6e54ae6 (diff)
downloadandroid_hardware_qcom_media-lineage-15.1-caf-8960.tar.gz
android_hardware_qcom_media-lineage-15.1-caf-8960.tar.bz2
android_hardware_qcom_media-lineage-15.1-caf-8960.zip
mm-video-v4l2: Fix KW resported issueslineage-15.1-caf-8960
* Add NULL pointer check in getRolesOfComponent Change-Id: Icc2c1e3cae3f213821608b8269da5b55f4ef43ba
-rw-r--r--libstagefrighthw/QComOMXPlugin.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libstagefrighthw/QComOMXPlugin.cpp b/libstagefrighthw/QComOMXPlugin.cpp
index 9446dcf6..135b6e28 100644
--- a/libstagefrighthw/QComOMXPlugin.cpp
+++ b/libstagefrighthw/QComOMXPlugin.cpp
@@ -115,8 +115,18 @@ OMX_ERRORTYPE QComOMXPlugin::getRolesOfComponent(
if (numRoles > 0) {
OMX_U8 **array = new OMX_U8 *[numRoles];
+ if (!array) {
+ return OMX_ErrorInsufficientResources;
+ }
for (OMX_U32 i = 0; i < numRoles; ++i) {
array[i] = new OMX_U8[OMX_MAX_STRINGNAME_SIZE];
+ if (!array[i]) {
+ for (OMX_U32 j = 0; j < i; ++j) {
+ delete[] array[j];
+ }
+ delete[] array;
+ return OMX_ErrorInsufficientResources;
+ }
}
OMX_U32 numRoles2;