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