0001-src-mp4track.cpp-replace-nullptr-by-NULL.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 78cf76b5d661e37e958163c37c0ad95940c09591 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 30 May 2020 11:42:19 +0200
  4. Subject: [PATCH] src/mp4track.cpp: replace nullptr by NULL
  5. Commit 15ec11166ba9ee7b77631d0d9234522f656cfd66 added code that uses
  6. nullptr. nullptr is C++11, it will break the build with gcc < 5.
  7. Semantically, NULL and nullptr are different, so should not be mixed.
  8. In this situaiton, m_File.FindAtom() indeed does not return nullptr,
  9. but NULL (on error, that is).
  10. Switch back to comparing against NULL.
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/14937c96a82fb3d10e5d83bd7b2905b846fb09f9
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. [Upstream status: https://github.com/TechSmith/mp4v2/pull/62]
  15. ---
  16. src/mp4track.cpp | 6 +++---
  17. 1 file changed, 3 insertions(+), 3 deletions(-)
  18. diff --git a/src/mp4track.cpp b/src/mp4track.cpp
  19. index 4b8fc9d..42489eb 100644
  20. --- a/src/mp4track.cpp
  21. +++ b/src/mp4track.cpp
  22. @@ -908,16 +908,16 @@ File* MP4Track::GetSampleFile( MP4SampleId sampleId )
  23. MP4FtypAtom *pFtypAtom = reinterpret_cast<MP4FtypAtom *>( m_File.FindAtom( "ftyp" ) );
  24. // MOV spec does not require "ftyp" atom...
  25. - if ( pFtypAtom == nullptr )
  26. + if ( pFtypAtom == NULL )
  27. {
  28. - return nullptr;
  29. + return NULL;
  30. }
  31. else
  32. {
  33. // ... but most often it is present with a "qt " value
  34. const char *majorBrand = pFtypAtom->majorBrand.GetValue();
  35. if ( ::strcmp( pFtypAtom->majorBrand.GetValue(), "qt " ) == 0 )
  36. - return nullptr;
  37. + return NULL;
  38. }
  39. throw new Exception( "invalid stsd entry", __FILE__, __LINE__, __FUNCTION__ );
  40. }
  41. --
  42. 2.26.2