[FIX] Fix issue #1421 (#1431)

* [Fix] Fix issue #1421

* Fix header offset
This commit is contained in:
nikolabr
2022-06-17 20:12:23 +02:00
committed by GitHub
parent 0f90afaa1b
commit 39724fe6a7

View File

@@ -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;