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

Unified Diff: Source/core/loader/ImageLoader.cpp

Issue 296343002: Fix potential crash related to loading an invalid image URL (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/ImageLoader.cpp
diff --git a/Source/core/loader/ImageLoader.cpp b/Source/core/loader/ImageLoader.cpp
index 3d561064dd258e60e2ef5c7d0abe400ad9b6fd37..44d27a1802d673a9113aba53de1d6b7ea6cb40b0 100644
--- a/Source/core/loader/ImageLoader.cpp
+++ b/Source/core/loader/ImageLoader.cpp
@@ -268,14 +268,15 @@ void ImageLoader::updateFromElement(LoadType loadType)
if (!m_failedLoadURL.isEmpty() && attr == m_failedLoadURL)
return;
+ // If we have a pending task, we have to clear it -- either we're
+ // now loading immediately, or we need to reset the task's state.
+ if (m_pendingTask) {
+ m_pendingTask->clearLoader();
+ m_pendingTask.clear();
+ }
+
KURL url = imageURL();
if (!attr.isNull() && !url.isNull()) {
- // If we have a pending task, we have to clear it -- either we're
- // now loading immediately, or we need to reset the task's state.
- if (m_pendingTask) {
- m_pendingTask->clearLoader();
- m_pendingTask.clear();
- }
bool loadImmediately = shouldLoadImmediately(url) || (loadType == ForceLoadImmediately);
if (loadImmediately) {
doUpdateFromElement(false);
« 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