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;