Bug 1320895 - Correct ADTS frame size calculation. r?gerald
This should be bitwise OR rather than logical OR, which just
returns 1. This code has clearly never worked, but it isn't
currently called.
MozReview-Commit-ID: 9Iuy7a7P85O
--- a/dom/media/mediasource/ContainerParser.cpp
+++ b/dom/media/mediasource/ContainerParser.cpp
@@ -579,18 +579,18 @@ public:
}
uint8_t frequency_index = ((*aData)[2] & 0x3c) >> 2;
MOZ_ASSERT(frequency_index < 16);
if (frequency_index == 15) {
MSE_DEBUG(ADTSContainerParser, "explicit frequency disallowed.");
return false;
}
size_t header_length = have_crc ? 9 : 7;
- size_t data_length = (((*aData)[3] & 0x03) << 11) ||
- (((*aData)[4] & 0xff) << 3) ||
+ size_t data_length = (((*aData)[3] & 0x03) << 11) |
+ (((*aData)[4] & 0xff) << 3) |
(((*aData)[5] & 0xe0) >> 5);
uint8_t frames = ((*aData)[6] & 0x03) + 1;
MOZ_ASSERT(frames > 0);
MOZ_ASSERT(frames < 4);
// Return successfully parsed data.
header.header_length = header_length;
header.frame_length = header_length + data_length;