summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlibstagefrighthw/QComOMXPlugin.cpp8
-rw-r--r--mm-video-v4l2/vidc/test/msm_vidc_test.c6
-rw-r--r--mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp7
3 files changed, 18 insertions, 3 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)();
}
}
diff --git a/mm-video-v4l2/vidc/test/msm_vidc_test.c b/mm-video-v4l2/vidc/test/msm_vidc_test.c
index 6aa8db31..55630250 100644
--- a/mm-video-v4l2/vidc/test/msm_vidc_test.c
+++ b/mm-video-v4l2/vidc/test/msm_vidc_test.c
@@ -3479,10 +3479,12 @@ int read_mpeg2_chunk_parse_key_frame(FILE * bits, unsigned char * pBuf)
} else {
length++;
}
- } while(curr_ptr < (read_size - 1));
+ } while(curr_ptr < (read_size - 2));
if ((keyFrame == 1) && (seqFound == 1) &&
- (curr_ptr <= (read_max + keyFrame_ptr))) {
+ (curr_ptr > keyFrame_ptr) &&
+ (keyFrame_ptr < read_max) &&
+ (curr_ptr <= read_max )) {
memcpy(pBuf + next_ptr, temp_buf+keyFrame_ptr, curr_ptr-keyFrame_ptr);
next_ptr += (curr_ptr-keyFrame_ptr);
}
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
index 7f3e925d..010773e8 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
@@ -4347,6 +4347,9 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
eRet = OMX_ErrorInsufficientResources;
}
+ if (eRet != OMX_ErrorNone)
+ return eRet;
+
if (dynamic_buf_mode) {
*bufferHdr = (m_out_mem_ptr + i );
(*bufferHdr)->pBuffer = NULL;
@@ -6131,6 +6134,10 @@ OMX_ERRORTYPE omx_vdec::fill_this_buffer_proxy(
pending_output_buffers++;
buffer = client_buffers.get_dr_buf_hdr(bufferAdd);
+ if (!buffer) {
+ DEBUG_PRINT_ERROR("err: client_buffer ptr invalid");
+ return OMX_ErrorBadParameter;
+ }
ptr_respbuffer = (struct vdec_output_frameinfo*)buffer->pOutputPortPrivate;
if (ptr_respbuffer) {
ptr_outputbuffer = (struct vdec_bufferpayload*)ptr_respbuffer->client_data;