diff --git a/src/add-ons/media/plugins/mov_reader/libMOV/MOVParser.cpp b/src/add-ons/media/plugins/mov_reader/libMOV/MOVParser.cpp index e8ad3b50f8..7fc5d92d1b 100644 --- a/src/add-ons/media/plugins/mov_reader/libMOV/MOVParser.cpp +++ b/src/add-ons/media/plugins/mov_reader/libMOV/MOVParser.cpp @@ -177,6 +177,10 @@ AtomBase *getAtom(BPositionIO *pStream) return new ESDSAtom(pStream, aStreamOffset, aAtomType, aRealAtomSize); } + if (aAtomType == uint32('ftyp')) { + return new FTYPAtom(pStream, aStreamOffset, aAtomType, aRealAtomSize); + } + return new AtomBase(pStream, aStreamOffset, aAtomType, aRealAtomSize); } @@ -855,7 +859,7 @@ void STSDAtom::ReadSoundDescription() memcpy(aSoundDescriptionV1->theVOL,dynamic_cast(aAtomBase)->getVOL(),aSoundDescriptionV1->VOLSize); } - if (aAtomBase->getAtomSize() > 0) { + if ((aAtomBase->getAtomSize() > 0) && (descBytesLeft >= aAtomBase->getAtomSize())) { descBytesLeft = descBytesLeft - aAtomBase->getAtomSize(); } else { DEBUGGER("Invalid Atom found when reading Sound Description\n"); @@ -1423,3 +1427,20 @@ char *SMHDAtom::OnGetAtomName() { return "Quicktime Sound Media Header"; } + +FTYPAtom::FTYPAtom(BPositionIO *pStream, off_t pstreamOffset, uint32 patomType, uint64 patomSize) : AtomBase(pStream, pstreamOffset, patomType, patomSize) +{ +} + +FTYPAtom::~FTYPAtom() +{ +} + +void FTYPAtom::OnProcessMetaData() +{ +} + +char *FTYPAtom::OnGetAtomName() +{ + return "Quicktime File Type"; +} diff --git a/src/add-ons/media/plugins/mov_reader/libMOV/MOVParser.h b/src/add-ons/media/plugins/mov_reader/libMOV/MOVParser.h index de14d7fb48..e4e3792af9 100644 --- a/src/add-ons/media/plugins/mov_reader/libMOV/MOVParser.h +++ b/src/add-ons/media/plugins/mov_reader/libMOV/MOVParser.h @@ -472,4 +472,13 @@ private: hdlr theHeader; }; +class FTYPAtom : public AtomBase { +public: + FTYPAtom(BPositionIO *pStream, off_t pstreamOffset, uint32 patomType, uint64 patomSize); + virtual ~FTYPAtom(); + void OnProcessMetaData(); + char *OnGetAtomName(); + +}; + #endif