History

Don't needlessly copy the input parameter struct

Martin Storsjö committed 12 years ago

Commit 2438b311 parent bcd57f41 file · +3 −8Browse files

Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+3−8
@@ -212,11 +212,8 @@ int CWelsH264SVCEncoder::Initialize (SEncParamBase* argv, const INIT_TYPE iInitT · 211 unmodified lines
212 SWelsSvcCodingParam sConfig (true);212 SWelsSvcCodingParam sConfig (true);
213 if(iInitType == INIT_TYPE_PARAMETER_BASED)213 if(iInitType == INIT_TYPE_PARAMETER_BASED)
214 {214 {
215 SEncParamBase sEncodingParam;
216 memcpy (&sEncodingParam, argv, sizeof (SEncParamBase)); // confirmed_safe_unsafe_usage
217
218 // Convert SEncParamBase into WelsSVCParamConfig here..215 // Convert SEncParamBase into WelsSVCParamConfig here..
219 if (sConfig.ParamBaseTranscode (sEncodingParam, true)) {216 if (sConfig.ParamBaseTranscode (*argv, true)) {
220 WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n");217 WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n");
221 Uninitialize();218 Uninitialize();
222 return cmInitParaError;219 return cmInitParaError;
@@ -224,10 +221,8 @@ int CWelsH264SVCEncoder::Initialize (SEncParamBase* argv, const INIT_TYPE iInitT · 1 unmodified line
224 }221 }
225 else if(iInitType == INIT_TYPE_PARAMETER_EXT)222 else if(iInitType == INIT_TYPE_PARAMETER_EXT)
226 {223 {
227 SEncParamExt sEncodingParam;224 // Convert SEncParamExt into WelsSVCParamConfig here..
228 memcpy (&sEncodingParam, argv, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage225 if (sConfig.ParamTranscode (*(const SEncParamExt*)argv, true)) {
229 // Convert SEncParamBase into WelsSVCParamConfig here..
230 if (sConfig.ParamTranscode (sEncodingParam, true)) {
231 WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n");226 WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n");
232 Uninitialize();227 Uninitialize();
233 return cmInitParaError;228 return cmInitParaError;

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