summaryrefslogtreecommitdiff
path: root/mm-video-v4l2
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-11-22 15:38:45 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-11-22 15:38:45 -0800
commit8bdbb6ac75051d2be1099a47b47321fe6d83dd40 (patch)
tree18c229f577f565cf60d5795dbf2ebad2fd73f683 /mm-video-v4l2
parent76a5332188643a654f91ae4c2dc47d6d7fa25549 (diff)
parent94ee46b676aff8b90d9f21198843a8deae99408f (diff)
downloadmedia-8bdbb6ac75051d2be1099a47b47321fe6d83dd40.tar.gz
Merge "mm-video-v4l2: venc: Reject graphic buffer queued with wrong dimensions"
Diffstat (limited to 'mm-video-v4l2')
-rw-r--r--mm-video-v4l2/vidc/venc/src/omx_video_base.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
index 3943677b..ff3f703a 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
@@ -4031,6 +4031,16 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE hComp,
DEBUG_PRINT_LOW("ETB (meta-gralloc) fd = %d, offset = %d, size = %d",
Input_pmem_info.fd, Input_pmem_info.offset,
Input_pmem_info.size);
+ // if input buffer dimensions is different from what is configured,
+ // reject the buffer
+ if ((int)m_sInPortDef.format.video.nFrameWidth != handle->unaligned_width ||
+ (int)m_sInPortDef.format.video.nFrameHeight != handle->unaligned_height) {
+ ALOGE("Graphic buf size(%dx%d) does not match configured size(%ux%u)",
+ handle->unaligned_width, handle->unaligned_height,
+ m_sInPortDef.format.video.nFrameWidth, m_sInPortDef.format.video.nFrameHeight);
+ post_event ((unsigned long)buffer, 0, OMX_COMPONENT_GENERATE_EBD);
+ return OMX_ErrorNone;
+ }
}
if (dev_use_buf(PORT_INDEX_IN) != true) {
DEBUG_PRINT_ERROR("ERROR: in dev_use_buf");