Bug 1320895 - Correct ADTS frame size calculation. r=gerald
authorRalph Giles <giles@mozilla.com>
Wed, 30 Nov 2016 13:23:18 -0800
changeset 324880 ff6eea6062d469834591bc94a4c01ecdb76c0f8e
parent 324879 3a7865514be5be079dca60c4e9c2ce1e05e0fd8c
child 324881 928ed9aab0b9a46c728758fd1f7959fa975f9350
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersgerald
bugs1320895
milestone53.0a1
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;