From c9972b98e7019e3720e9140d0e4ed555638f4007 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Wed, 21 Sep 2016 19:56:58 -0700 Subject: [PATCH] Backed out changeset 9b7d9479690e (bug 1304303) for gtest and mda failures CLOSED TREE --- media/libstagefright/binding/MoofParser.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/media/libstagefright/binding/MoofParser.cpp b/media/libstagefright/binding/MoofParser.cpp index 9612b9074741..354fcf484e17 100644 --- a/media/libstagefright/binding/MoofParser.cpp +++ b/media/libstagefright/binding/MoofParser.cpp @@ -848,11 +848,14 @@ Saiz::Saiz(Box& aBox, AtomType aDefaultType) uint8_t defaultSampleInfoSize = reader->ReadU8(); uint32_t count = reader->ReadU32(); if (defaultSampleInfoSize) { - if (!mSampleInfoSize.SetLength(count, fallible)) { + if (!mSampleInfoSize.SetCapacity(count, fallible)) { LOG(Saiz, "OOM"); return; } - MOZ_ALWAYS_TRUE(mSampleInfoSize.ReplaceElementsAt(0, count, defaultSampleInfoSize, fallible)); + for (int i = 0; i < count; i++) { + MOZ_ALWAYS_TRUE(mSampleInfoSize.AppendElement(defaultSampleInfoSize, + fallible)); + } } else { if (!reader->ReadArray(mSampleInfoSize, count)) { LOG(Saiz, "Incomplete Box (OOM or missing count:%u)", count);