A string constant is guaranteed to be null terminated, and thus doesn't need to use a version of strlen with a fixed buffer size limit.
Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 4 files). Show all
Unified · Split
| @@ -994,7 +994,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 993 unmodified lines | ||
| 994 | 994 | str_t strFileName[256] = {0}; |
| 995 | 995 | const int32_t iDataLength = m_iMaxPicWidth * m_iMaxPicHeight; |
| 996 | 996 | |
| 997 | − STRNCPY (strFileName, 256, "pic_in_", STRNLEN ("pic_in_", 255)); // confirmed_safe_unsafe_usage | |
| 997 | + STRNCPY (strFileName, 256, "pic_in_", strlen ("pic_in_")); // confirmed_safe_unsafe_usage | |
| 998 | 998 | |
| 999 | 999 | if (m_iMaxPicWidth == 640) { |
| 1000 | 1000 | STRCAT (strFileName, 256, "360p."); // confirmed_safe_unsafe_usage |