Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 1856373004: Fix potential null pointer access in HTMLMediaElement::seek (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix potential null pointer in HTMLMediaElement::seek Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 WTF_LOG(Media, "HTMLMediaElement::setIgnorePreloadNone(%p)", this); 1683 WTF_LOG(Media, "HTMLMediaElement::setIgnorePreloadNone(%p)", this);
1684 m_ignorePreloadNone = true; 1684 m_ignorePreloadNone = true;
1685 setPlayerPreload(); 1685 setPlayerPreload();
1686 } 1686 }
1687 1687
1688 void HTMLMediaElement::seek(double time) 1688 void HTMLMediaElement::seek(double time)
1689 { 1689 {
1690 WTF_LOG(Media, "HTMLMediaElement::seek(%p, %f)", this, time); 1690 WTF_LOG(Media, "HTMLMediaElement::seek(%p, %f)", this, time);
1691 1691
1692 // 2 - If the media element's readyState is HAVE_NOTHING, abort these steps. 1692 // 2 - If the media element's readyState is HAVE_NOTHING, abort these steps.
1693 if (m_readyState == HAVE_NOTHING) 1693 // FIXME: remove m_webMediaPlayer check once we figure out how
1694 // m_webMediaPlayer is going out of sync with readystate.
1695 // m_webMediaPlayer is cleared but readystate is not set to HAVE_NOTHING.
1696 if (!m_webMediaPlayer || m_readyState == HAVE_NOTHING)
1694 return; 1697 return;
1695 1698
1696 // Ignore preload none and start load if necessary. 1699 // Ignore preload none and start load if necessary.
1697 setIgnorePreloadNone(); 1700 setIgnorePreloadNone();
1698 1701
1699 // Get the current time before setting m_seeking, m_lastSeekTime is returned once it is set. 1702 // Get the current time before setting m_seeking, m_lastSeekTime is returned once it is set.
1700 refreshCachedTime(); 1703 refreshCachedTime();
1701 // This is needed to avoid getting default playback start position from curr entTime(). 1704 // This is needed to avoid getting default playback start position from curr entTime().
1702 double now = m_cachedTime; 1705 double now = m_cachedTime;
1703 1706
(...skipping 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after
3865 3868
3866 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co nst 3869 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co nst
3867 { 3870 {
3868 IntRect result; 3871 IntRect result;
3869 if (LayoutObject* object = m_element->layoutObject()) 3872 if (LayoutObject* object = m_element->layoutObject())
3870 result = object->absoluteBoundingBoxRect(); 3873 result = object->absoluteBoundingBoxRect();
3871 return result; 3874 return result;
3872 } 3875 }
3873 3876
3874 } // namespace blink 3877 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698