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 | 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_usage | 225 | 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; |