From 2d39b5201487d68570fc0b63836809c63b7dd018 Mon Sep 17 00:00:00 2001 From: Xenona Date: Wed, 31 Jan 2024 20:14:37 +0300 Subject: [PATCH] Fixed ESDS size parsing --- src/descriptor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/descriptor.js b/src/descriptor.js index a8d8b13e..b5ae50cd 100644 --- a/src/descriptor.js +++ b/src/descriptor.js @@ -32,11 +32,11 @@ var MPEG4DescriptorParser = function () { byteRead = stream.readUint8(); hdrSize++; while (byteRead & 0x80) { - size = (byteRead & 0x7F)<<7; + size = (size << 7) + (byteRead & 0x7F); byteRead = stream.readUint8(); hdrSize++; } - size += byteRead & 0x7F; + size = (size << 7) + (byteRead & 0x7F); Log.debug("MPEG4DescriptorParser", "Found "+(descTagToName[tag] || "Descriptor "+tag)+", size "+size+" at position "+stream.getPosition()); if (descTagToName[tag]) { desc = new classes[descTagToName[tag]](size);