From edce4188ef3abd491c216b9218333aaea77688cb Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Mon, 2 Mar 2015 09:47:04 -0800 Subject: [PATCH] Bug 1135170 - Pin MediaResource in OggReader::GetSeekRanges. r=mattwoodrow All consumers of MediaCacheStream::GetCachedRanges do this except this one. --- dom/media/ogg/OggReader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/media/ogg/OggReader.cpp b/dom/media/ogg/OggReader.cpp index f00b0940dba..3f1295a8e60 100644 --- a/dom/media/ogg/OggReader.cpp +++ b/dom/media/ogg/OggReader.cpp @@ -1182,8 +1182,9 @@ int64_t OggReader::RangeEndTime(int64_t aStartOffset, nsresult OggReader::GetSeekRanges(nsTArray& aRanges) { NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread."); + AutoPinned resource(mDecoder->GetResource()); nsTArray cached; - nsresult res = mDecoder->GetResource()->GetCachedRanges(cached); + nsresult res = resource->GetCachedRanges(cached); NS_ENSURE_SUCCESS(res, res); for (uint32_t index = 0; index < cached.Length(); index++) {