From 39724fe6a78b56455ca9cd98babda4e7245773f7 Mon Sep 17 00:00:00 2001 From: nikolabr <64268040+nikolabr@users.noreply.github.com> Date: Fri, 17 Jun 2022 20:12:23 +0200 Subject: [PATCH] [FIX] Fix issue #1421 (#1431) * [Fix] Fix issue #1421 * Fix header offset --- src/lib_ccx/stream_functions.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib_ccx/stream_functions.c b/src/lib_ccx/stream_functions.c index a91941fc..c2e2c771 100644 --- a/src/lib_ccx/stream_functions.c +++ b/src/lib_ccx/stream_functions.c @@ -482,6 +482,10 @@ int isValidMP4Box(unsigned char *buffer, size_t position, size_t *nextBoxLocatio buffer[position + 6] == ccx_stream_mp4_boxes[idx].boxType[2] && buffer[position + 7] == ccx_stream_mp4_boxes[idx].boxType[3]) { mprint("Detected MP4 box with name: %s\n", ccx_stream_mp4_boxes[idx].boxType); + // If the box type is "moov", check if it contains a valid movie header + if (idx == 2 && !( buffer[position + 12] == 'm' && buffer[position + 13] == 'v' && buffer[position + 14] == 'h' && buffer[position + 15] == 'd' )) { + continue; + } // Box name matches. Do crude validation of possible box size, and if valid, add points for "valid" box size_t boxSize = buffer[position] << 24; boxSize |= buffer[position + 1] << 16;