diff options
author | Shivaprasad Hongal <shongal@codeaurora.org> | 2015-07-09 17:08:42 -0700 |
---|---|---|
committer | Chong Zhang <chz@google.com> | 2015-07-09 18:04:55 -0700 |
commit | 38bb5a473d10ab6a86caa32e1a587f41e94ca500 (patch) | |
tree | 0cc4398cd06722d7fe89bfe15536d1a03e2c9c93 | |
parent | dce0acfcb3cdf6eceef84f22def392cc6d4557ab (diff) | |
download | android_hardware_qcom_media-38bb5a473d10ab6a86caa32e1a587f41e94ca500.tar.gz android_hardware_qcom_media-38bb5a473d10ab6a86caa32e1a587f41e94ca500.tar.bz2 android_hardware_qcom_media-38bb5a473d10ab6a86caa32e1a587f41e94ca500.zip |
mm-video-v4l2: Initialize pipe fd's to -1
While creating a new instance when HW is oveloaded,
we return error with out creating pipe fd's.
In omx_video destructor it is closing pipes, since
the pipes are not initialized there is a chance
of closing valid pipe fd's of running instances
because of some garbage values present in it.
Hence initialized with -1.
BUG: 21659665
Change-Id: I1e04a159c41c104959db27b657866120696cb842
-rw-r--r-- | mm-video-legacy/vidc/venc/src/omx_video_base.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mm-video-legacy/vidc/venc/src/omx_video_base.cpp b/mm-video-legacy/vidc/venc/src/omx_video_base.cpp index a0dd45be..dd4d98d8 100644 --- a/mm-video-legacy/vidc/venc/src/omx_video_base.cpp +++ b/mm-video-legacy/vidc/venc/src/omx_video_base.cpp @@ -1,5 +1,5 @@ /*-------------------------------------------------------------------------- -Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved. +Copyright (c) 2010-2012, 2015 Code Aurora Forum. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -249,6 +249,8 @@ omx_video::omx_video(): msg_thread_id(0), m_use_output_pmem(OMX_FALSE), m_etb_count(0), m_fbd_count(0), + m_pipe_in(-1), + m_pipe_out(-1), m_error_propogated(false), m_input_msg_id(OMX_COMPONENT_GENERATE_ETB), psource_frame(NULL), @@ -281,8 +283,8 @@ RETURN VALUE omx_video::~omx_video() { DEBUG_PRINT_HIGH("\n ~omx_video(): Inside Destructor()"); - if(m_pipe_in) close(m_pipe_in); - if(m_pipe_out) close(m_pipe_out); + if(m_pipe_in >= 0) close(m_pipe_in); + if(m_pipe_out >= 0) close(m_pipe_out); DEBUG_PRINT_HIGH("omx_video: Waiting on Msg Thread exit\n"); if (msg_thread_id != 0) { pthread_join(msg_thread_id,NULL); |