Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/mp4track.cpp: replace nullptr by NULL #62

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
src/mp4track.cpp: replace nullptr by NULL
Commit 15ec111 added code that uses
nullptr. nullptr is C++11, it will break the build with gcc < 5.

Semantically, NULL and nullptr are different, so should not be mixed.
In this situation, m_File.FindAtom() indeed does not return nullptr,
but NULL (on error, that is).

Switch back to comparing against NULL.

Fixes:
 - http://autobuild.buildroot.org/results/14937c96a82fb3d10e5d83bd7b2905b846fb09f9

[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/mp4v2/0002-src-mp4track.cpp-replace-nullptr-by-NULL.patch]
Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Dec 22, 2021
commit aaa158127737176d198d2e7e95198889d3a57188
6 changes: 3 additions & 3 deletions src/mp4track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,16 +908,16 @@ File* MP4Track::GetSampleFile( MP4SampleId sampleId )
MP4FtypAtom *pFtypAtom = reinterpret_cast<MP4FtypAtom *>( m_File.FindAtom( "ftyp" ) );

// MOV spec does not require "ftyp" atom...
if ( pFtypAtom == nullptr )
if ( pFtypAtom == NULL )
{
return nullptr;
return NULL;
}
else
{
// ... but most often it is present with a "qt " value
const char *majorBrand = pFtypAtom->majorBrand.GetValue();
if ( ::strcmp( pFtypAtom->majorBrand.GetValue(), "qt " ) == 0 )
return nullptr;
return NULL;
}
throw new Exception( "invalid stsd entry", __FILE__, __LINE__, __FUNCTION__ );
}
Expand Down