ref: 059e19074aed6836893ade9c6f0eb239579f9629
parent: 2ec91a0bbec08889d93322fd9a504eafcaa04e04
author: ruil2 <[email protected]>
date: Fri Aug 1 08:39:29 EDT 2014
add parameter verification
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -173,7 +173,8 @@
}
m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);
- WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::InitEncoder(), openh264 codec version = %s", VERSION_NUMBER);
+ WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::InitEncoder(), openh264 codec version = %s",
+ VERSION_NUMBER);
#ifdef REC_FRAME_COUNT
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
"CWelsH264SVCEncoder::InitEncoder, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal);
@@ -421,6 +422,8 @@
if (! (kpSrcPic && m_bInitialFlag && pBsInfo)) {
return cmInitParaError;
}
+ if (kpSrcPic->iColorFormat != videoFormatI420)
+ return cmInitParaError;
const int32_t kiEncoderReturn = EncodeFrameInternal (kpSrcPic, pBsInfo);