History

Merge pull request #251 from mstorsjo/crt-string-cleanup

Clean up the rest of the usage of crt_safe_util_x

Ethan Hugg committed 12 years ago

Commit 3c402612 parents 0d7bafc e0da5a18 files · +49 −423Browse files

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

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+8−8
@@ -994,20 +994,20 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 993 unmodified lines
994 str_t strFileName[256] = {0};994 str_t strFileName[256] = {0};
995 const int32_t iDataLength = m_iMaxPicWidth * m_iMaxPicHeight;995 const int32_t iDataLength = m_iMaxPicWidth * m_iMaxPicHeight;
996 996
997 STRNCPY (strFileName, 256, "pic_in_", STRNLEN ("pic_in_", 255)); // confirmed_safe_unsafe_usage997 WelsStrncpy (strFileName, 256, "pic_in_"); // confirmed_safe_unsafe_usage
998 998
999 if (m_iMaxPicWidth == 640) {999 if (m_iMaxPicWidth == 640) {
1000 STRCAT (strFileName, 256, "360p."); // confirmed_safe_unsafe_usage1000 WelsStrcat (strFileName, 256, "360p."); // confirmed_safe_unsafe_usage
1001 } else if (m_iMaxPicWidth == 320) {1001 } else if (m_iMaxPicWidth == 320) {
1002 STRCAT (strFileName, 256, "180p."); // confirmed_safe_unsafe_usage1002 WelsStrcat (strFileName, 256, "180p."); // confirmed_safe_unsafe_usage
1003 } else if (m_iMaxPicWidth == 160) {1003 } else if (m_iMaxPicWidth == 160) {
1004 STRCAT (strFileName, 256, "90p."); // confirmed_safe_unsafe_usage1004 WelsStrcat (strFileName, 256, "90p."); // confirmed_safe_unsafe_usage
1005 }1005 }
1006 1006
1007 switch (m_iCspInternal) {1007 switch (m_iCspInternal) {
1008 case videoFormatI420:1008 case videoFormatI420:
1009 case videoFormatYV12:1009 case videoFormatYV12:
1010 STRCAT (strFileName, 256, "yuv"); // confirmed_safe_unsafe_usage1010 WelsStrcat (strFileName, 256, "yuv"); // confirmed_safe_unsafe_usage
1011 pFile = WelsFopen (strFileName, "ab+");1011 pFile = WelsFopen (strFileName, "ab+");
1012 // WelsLog( m_pEncContext, WELS_LOG_INFO, "WELS_CSP_I420, m_iCspInternal= 0x%x\n", m_iCspInternal);1012 // WelsLog( m_pEncContext, WELS_LOG_INFO, "WELS_CSP_I420, m_iCspInternal= 0x%x\n", m_iCspInternal);
1013 if (NULL != pFile) {1013 if (NULL != pFile) {
@@ -1017,7 +1017,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 3 unmodified lines
1017 }1017 }
1018 break;1018 break;
1019 case videoFormatRGB:1019 case videoFormatRGB:
1020 STRCAT (strFileName, 256, "rgb"); // confirmed_safe_unsafe_usage1020 WelsStrcat (strFileName, 256, "rgb"); // confirmed_safe_unsafe_usage
1021 pFile = WelsFopen (strFileName, "ab+");1021 pFile = WelsFopen (strFileName, "ab+");
1022 if (NULL != pFile) {1022 if (NULL != pFile) {
1023 fwrite (pSrc, sizeof (uint8_t), iDataLength * 3, pFile);1023 fwrite (pSrc, sizeof (uint8_t), iDataLength * 3, pFile);
@@ -1025,7 +1025,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 1 unmodified line
1025 fclose (pFile);1025 fclose (pFile);
1026 }1026 }
1027 case videoFormatBGR:1027 case videoFormatBGR:
1028 STRCAT (strFileName, 256, "bgr"); // confirmed_safe_unsafe_usage1028 WelsStrcat (strFileName, 256, "bgr"); // confirmed_safe_unsafe_usage
1029 pFile = WelsFopen (strFileName, "ab+");1029 pFile = WelsFopen (strFileName, "ab+");
1030 // WelsLog( m_pEncContext, WELS_LOG_INFO, "WELS_CSP_BGR, m_iCspInternal= 0x%x\n", m_iCspInternal);1030 // WelsLog( m_pEncContext, WELS_LOG_INFO, "WELS_CSP_BGR, m_iCspInternal= 0x%x\n", m_iCspInternal);
1031 if (NULL != pFile) {1031 if (NULL != pFile) {
@@ -1035,7 +1035,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 3 unmodified lines
1035 }1035 }
1036 break;1036 break;
1037 case videoFormatYUY2:1037 case videoFormatYUY2:
1038 STRCAT (strFileName, 256, "yuy2"); // confirmed_safe_unsafe_usage1038 WelsStrcat (strFileName, 256, "yuy2"); // confirmed_safe_unsafe_usage
1039 pFile = WelsFopen (strFileName, "ab+");1039 pFile = WelsFopen (strFileName, "ab+");
1040 if (NULL != pFile) {1040 if (NULL != pFile) {
1041 fwrite (pSrc, sizeof (uint8_t), (CALC_BI_STRIDE (m_iMaxPicWidth, 16)) * m_iMaxPicHeight, pFile);1041 fwrite (pSrc, sizeof (uint8_t), (CALC_BI_STRIDE (m_iMaxPicWidth, 16)) * m_iMaxPicHeight, pFile);

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