Bug 1202332 - XiphExtradataToHeaders miscalculates final header length. r=derf a=ritu
authorMatthew Gregan <kinetik@flim.org>
Tue, 08 Sep 2015 11:33:16 +1200
changeset 289253 ad977f64142b4b00aa0df5d801196ff413f44277
parent 289252 ed38d632a308b8d0c9dc3d8c8f347016aa83d7aa
child 289254 6fa940a15b9328f1b9d8e8826c45242de0ebccf2
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersderf, ritu
bugs1202332
milestone42.0a2
Bug 1202332 - XiphExtradataToHeaders miscalculates final header length. r=derf a=ritu
dom/media/XiphExtradata.cpp
--- a/dom/media/XiphExtradata.cpp
+++ b/dom/media/XiphExtradata.cpp
@@ -64,17 +64,17 @@ bool XiphExtradataToHeaders(nsTArray<uns
     // to underflow.
     if (aAvailable - total < headerLen) {
       return false;
     }
     aHeaderLens.AppendElement(headerLen);
     // Since we know aAvailable >= total + headerLen, this can't overflow.
     total += headerLen;
   }
-  aHeaderLens.AppendElement(aAvailable);
+  aHeaderLens.AppendElement(aAvailable - total);
   for (int i = 0; i < nHeaders; i++) {
     aHeaders.AppendElement(aData);
     aData += aHeaderLens[i];
   }
   return true;
 }
 
 } // namespace mozilla