Changes between Initial Version and Version 1 of Ticket #18513, comment 2
- Timestamp:
- Mar 21, 2019 11:04:00 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #18513, comment 2
initial v1 4 4 As I mentioned above, a solution of this bug is to modify the line 950 to "char *pszSuff = NULL;". 5 5 6 However, it's still not perfect, because I found that if the video recording path is " C:\abc.def"(modified by user), it will still work incorrectly, becasue the final path is "C:\abc.webm" but not "C:\abc.def.webm", which including the VM full name "abc.def".6 However, it's still not perfect, because I found that if the video recording path is "'''C:\abc.def'''"(manually modified by user), it will still work incorrectly, it leads to a final path "'''C:\abc.webm'''" but not "'''C:\abc.def.webm'''", which including the VM full name "'''abc.def'''". 7 7 8 8 I think the main reason is the line 947. 9 9 10 It tries to remove something from the video recording path input by user.10 It tries to '''remove''' the suffix from the video recording path unconditionally. 11 11 12 Why not try to add the suffix to the path?13 12 14 That means we just judge whether the path specified by user includes the ".webm" suffix, if not yet, we add the suffix to the path, if it has included the suffix already, just let it go. 13 So let's just try the code below: 15 14 16 Sorry, I am a lazy guy, so just please fix the bug by yourself, because I am going to fly several hours later.Ha Ha Ha Ha..... 15 ------------------------------------------------------------------------------------ 16 17 944 char *pszAbsPath = RTPathAbsDup(com::Utf8Str(pCfg->File.strName).c_str());[[BR]] 18 19 945 AssertPtrReturn(pszAbsPath, VERR_NO_MEMORY);[[BR]] 20 21 22 947 '''if (_stricmp(RTPathSuffix(pszAbsPath), ".webm") == 0)'''[[BR]] 23 24 948 {[[BR]] 25 26 949 '''RTPathStripSuffix(pszAbsPath);'''[[BR]] 27 28 950 }[[BR]] 29 30 31 952 AssertPtrReturn(pszAbsPath, VERR_INVALID_PARAMETER);[[BR]] 32 33 34 953 '''char *pszSuff = RTStrDup(".webm");'''[[BR]] 35 36 37 955 if (!pszSuff)[[BR]] 38 39 956 {[[BR]] 40 41 957 RTStrFree(pszAbsPath);[[BR]] 42 43 958 return VERR_NO_MEMORY;[[BR]] 44 45 959 }[[BR]] 46 47 48 ------------------------------------------------------------------------------------ 49 50 Thanks! 17 51 18 52 Replying to [ticket:18513 cleanner]: