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