Changeset 181453 in webkit
- Timestamp:
- Mar 12, 2015, 1:37:13 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r181449 r181453 1 2015-03-12 Geoffrey Garen <ggaren@apple.com> 2 3 REGRESSION: Crash under Heap::reportExtraMemoryAllocatedSlowCase for media element 4 https://bugs.webkit.org/show_bug.cgi?id=142636 5 6 Reviewed by Mark Hahnenberg. 7 8 This was a pre-existing bug that I made a lot worse in 9 <https://trac.webkit.org/changeset/181411>. 10 11 * html/HTMLMediaElement.cpp: 12 (WebCore::HTMLMediaElement::parseAttribute): Compare size before 13 subtracting rather than subtracting and then comparing to zero. The 14 latter technique is not valid for unsigned integers, which will happily 15 underflow into giant numbers. 16 17 * Modules/mediasource/SourceBuffer.cpp: 18 (WebCore::SourceBuffer::reportExtraMemoryAllocated): This code was 19 technically correct, but I took the opportunity to clean it up a bit. 20 There's no need to do two checks here, and it smells bad to check for 21 a negative unsigned integer. 22 1 23 2015-03-12 Sebastian Dröge <sebastian@centricular.com> 2 24 -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
r181411 r181453 1992 1992 { 1993 1993 size_t extraMemoryCost = this->extraMemoryCost(); 1994 if (extraMemoryCost < m_reportedExtraMemoryCost)1994 if (extraMemoryCost <= m_reportedExtraMemoryCost) 1995 1995 return; 1996 1996 … … 1999 1999 2000 2000 JSC::JSLockHolder lock(scriptExecutionContext()->vm()); 2001 if (extraMemoryCostDelta > 0) { 2002 // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated. 2003 // https://bugs.webkit.org/show_bug.cgi?id=142595 2004 scriptExecutionContext()->vm().heap.deprecatedReportExtraMemory(extraMemoryCostDelta); 2005 } 2001 // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated. 2002 // https://bugs.webkit.org/show_bug.cgi?id=142595 2003 scriptExecutionContext()->vm().heap.deprecatedReportExtraMemory(extraMemoryCostDelta); 2006 2004 } 2007 2005 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r181423 r181453 634 634 635 635 if (m_player) { 636 JSC::VM& vm = JSDOMWindowBase::commonVM();637 JSC::JSLockHolder lock(vm);638 639 636 size_t extraMemoryCost = m_player->extraMemoryCost(); 640 size_t extraMemoryCostDelta = extraMemoryCost - m_reportedExtraMemoryCost; 641 m_reportedExtraMemoryCost = extraMemoryCost; 642 643 if (extraMemoryCostDelta > 0) { 637 if (extraMemoryCost > m_reportedExtraMemoryCost) { 638 JSC::VM& vm = JSDOMWindowBase::commonVM(); 639 JSC::JSLockHolder lock(vm); 640 641 size_t extraMemoryCostDelta = extraMemoryCost - m_reportedExtraMemoryCost; 642 m_reportedExtraMemoryCost = extraMemoryCost; 644 643 // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated. 645 644 // https://bugs.webkit.org/show_bug.cgi?id=142595
Note:
See TracChangeset
for help on using the changeset viewer.