Fix some bugs found by the compiler https://github.com/TechSmith/mp4v2/commit/8d6307ea1e70c0a44dd2a64c4fa1a8f42b803ebf --- libutil/Utility.cpp.orig +++ libutil/Utility.cpp @@ -480,7 +480,7 @@ Utility::process_impl() } for( ;; ) { - const int code = prog::getOption( _argc, _argv, _shortOptions.c_str(), _longOptions, NULL ); + const unsigned int code = prog::getOption( _argc, _argv, _shortOptions.c_str(), _longOptions, NULL ); if( code == -1 ) break; --- src/mp4.cpp.orig +++ src/mp4.cpp @@ -864,18 +864,11 @@ MP4FileHandle MP4ReadProvider( const char* fileName, const MP4FileProvider* file // mp4v2_ismacrypParams *MP4DefaultISMACrypParams(mp4v2_ismacrypParams *ptr) { - try - { - if (ptr == NULL) { - ptr = (mp4v2_ismacrypParams *)MP4Malloc(sizeof(mp4v2_ismacrypParams)); - } - memset(ptr, 0, sizeof(*ptr)); - return ptr; - } - - catch (...) { - return MP4_INVALID_TRACK_ID; - } + if (ptr == NULL) { + ptr = (mp4v2_ismacrypParams *)MP4Malloc(sizeof(mp4v2_ismacrypParams)); + } + memset(ptr, 0, sizeof(*ptr)); + return ptr; } --- src/rtphint.cpp.orig +++ src/rtphint.cpp @@ -339,7 +339,7 @@ void MP4RtpHintTrack::GetPayload( pSlash = strchr(pSlash, '/'); if (pSlash != NULL) { pSlash++; - if (pSlash != '\0') { + if ( *pSlash != '\0' ) { length = (uint32_t)strlen(pRtpMap) - (pSlash - pRtpMap); *ppEncodingParams = (char *)MP4Calloc(length + 1); strncpy(*ppEncodingParams, pSlash, length);