From f7c48df2607b91662189ada5fd094f98b274fe09 Mon Sep 17 00:00:00 2001 From: MikeTuev Date: Sat, 23 Sep 2023 00:01:25 +0500 Subject: [PATCH] Fixed a bug that could cause negative general_profile_compatibility hex value to be returned Bug: if general_profile_compatibility negative after reverse, then decimalToHex() returns negative hex value and mime codec, generated by test/node/mp4codec.js will be wrong. This commit fixes this. --- src/box-codecs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/box-codecs.js b/src/box-codecs.js index 24743823..252fa9c8 100644 --- a/src/box-codecs.js +++ b/src/box-codecs.js @@ -132,7 +132,7 @@ BoxParser.hvc1SampleEntry.prototype.getCodec = function() { reversed <<= 1; val >>=1; } - baseCodec += BoxParser.decimalToHex(reversed, 0); + baseCodec += BoxParser.decimalToHex(reversed >>> 0, 0); baseCodec += '.'; if (this.hvcC.general_tier_flag === 0) { baseCodec += 'L';