0001-Fix-GCC7-build.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. From 855e9674232808ff3be7191b697dfb56917db21f Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= <sergio@serjux.com>
  3. Date: Wed, 8 Feb 2017 00:56:32 +0000
  4. Subject: [PATCH] Fix GCC7 build
  5. if (*pSlash != '\0') {
  6. As it stands the body of that if will always execute and when there are
  7. no encoding parameters ppEncodingParams will be returned as a pointer to
  8. an empty string rather than as a null pointer
  9. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  10. [Upstream status: https://github.com/TechSmith/mp4v2/pull/36]
  11. ---
  12. src/rtphint.cpp | 2 +-
  13. 1 file changed, 1 insertion(+), 1 deletion(-)
  14. diff --git a/src/rtphint.cpp b/src/rtphint.cpp
  15. index e07309d..1eb01f5 100644
  16. --- a/src/rtphint.cpp
  17. +++ b/src/rtphint.cpp
  18. @@ -339,7 +339,7 @@ void MP4RtpHintTrack::GetPayload(
  19. pSlash = strchr(pSlash, '/');
  20. if (pSlash != NULL) {
  21. pSlash++;
  22. - if (pSlash != '\0') {
  23. + if (*pSlash != '\0') {
  24. length = (uint32_t)strlen(pRtpMap) - (pSlash - pRtpMap);
  25. *ppEncodingParams = (char *)MP4Calloc(length + 1);
  26. strncpy(*ppEncodingParams, pSlash, length);
  27. --
  28. 2.11.0