Bug 1320895 - Correct ADTS frame size calculation. r=gerald
authorRalph Giles <giles@mozilla.com>
Wed, 30 Nov 2016 13:23:18 -0800
changeset 324870 ff6eea6062d469834591bc94a4c01ecdb76c0f8e
parent 324869 3a7865514be5be079dca60c4e9c2ce1e05e0fd8c
child 324871 928ed9aab0b9a46c728758fd1f7959fa975f9350
push id84525
push userphilringnalda@gmail.com
push dateThu, 01 Dec 2016 03:22:09 +0000
treeherdermozilla-inbound@b1d875f4c673 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1320895
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/media/mediasource/ContainerParser.cpp
--- 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;