History

add protection and remove redundant param

sijchen@cisco.com committed 9 years ago

Commit af774e41 parent 8386ac82 files · +12 −7Browse files

Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 2 files). Show all

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+9−3
@@ -347,7 +347,10 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 346 unmodified lines
347347 "CWelsDecoder::SetOption():DECODER_OPTION_GET_STATISTICS: this option is get-only!");
348348 return cmInitParaError;
349349 } else if (eOptID == DECODER_OPTION_STATISTICS_LOG_INTERVAL) {
350− m_pDecContext->sDecoderStatistics.iStatisticsLogInterval = (* ((unsigned int*)pOption));
350+ if (pOption) {
351+ m_pDecContext->sDecoderStatistics.iStatisticsLogInterval = (* ((unsigned int*)pOption));
352+ return cmResultSuccess;
353+ }
351354 } else if (eOptID == DECODER_OPTION_GET_SAR_INFO) {
352355 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING,
353356 "CWelsDecoder::SetOption():DECODER_OPTION_GET_SAR_INFO: this option is get-only!");
@@ -418,8 +421,11 @@ long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void* pOption) { · 64 unmodified lines
418421 }
419422 return cmResultSuccess;
420423 } else if (eOptID == DECODER_OPTION_STATISTICS_LOG_INTERVAL) {
421− iVal = m_pDecContext->sDecoderStatistics.iStatisticsLogInterval;
422− * ((unsigned int*)pOption) = iVal;
424+ if (pOption) {
425+ iVal = m_pDecContext->sDecoderStatistics.iStatisticsLogInterval;
426+ * ((unsigned int*)pOption) = iVal;
427+ return cmResultSuccess;
428+ }
423429 } else if (DECODER_OPTION_GET_SAR_INFO == eOptID) { //get decoder SAR info in VUI
424430 PVuiSarInfo pVuiSarInfo = (static_cast<PVuiSarInfo> (pOption));
425431 memset (pVuiSarInfo, 0, sizeof (SVuiSarInfo));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t