From ffea12e7055ba95b4b907cc140785cfb1c420c64 Mon Sep 17 00:00:00 2001 From: Gilles Boccon-Gibod Date: Sun, 27 Feb 2022 19:11:11 -0800 Subject: [PATCH] fix #434 --- Source/C++/Core/Ap4DescriptorFactory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/C++/Core/Ap4DescriptorFactory.cpp b/Source/C++/Core/Ap4DescriptorFactory.cpp index 907277dd1..1db798624 100644 --- a/Source/C++/Core/Ap4DescriptorFactory.cpp +++ b/Source/C++/Core/Ap4DescriptorFactory.cpp @@ -127,6 +127,9 @@ AP4_DescriptorFactory::CreateDescriptorFromStream(AP4_ByteStream& stream, descriptor = new AP4_UnknownDescriptor(stream, tag, header_size, payload_size); break; } + } else { + stream.Seek(offset); + return AP4_ERROR_INVALID_FORMAT; } // skip to the end of the descriptor