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

Side by Side Diff: Source/core/svg/animation/SVGSMILElement.cpp

Issue 144333002: Prevent crash in createInstanceTimesFromSyncbase (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/svg/animations/smil-syncbase-self-dependency-expected.txt ('k') | 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 for (unsigned n = 0; n < m_conditions.size(); ++n) { 1238 for (unsigned n = 0; n < m_conditions.size(); ++n) {
1239 Condition& condition = m_conditions[n]; 1239 Condition& condition = m_conditions[n];
1240 if (condition.m_type == Condition::Syncbase && condition.m_syncbase == s yncbase) { 1240 if (condition.m_type == Condition::Syncbase && condition.m_syncbase == s yncbase) {
1241 ASSERT(condition.m_name == "begin" || condition.m_name == "end"); 1241 ASSERT(condition.m_name == "begin" || condition.m_name == "end");
1242 // No nested time containers in SVG, no need for crazy time space co nversions. Phew! 1242 // No nested time containers in SVG, no need for crazy time space co nversions. Phew!
1243 SMILTime time = 0; 1243 SMILTime time = 0;
1244 if (condition.m_name == "begin") 1244 if (condition.m_name == "begin")
1245 time = syncbase->m_intervalBegin + condition.m_offset; 1245 time = syncbase->m_intervalBegin + condition.m_offset;
1246 else 1246 else
1247 time = syncbase->m_intervalEnd + condition.m_offset; 1247 time = syncbase->m_intervalEnd + condition.m_offset;
1248 ASSERT(time.isFinite()); 1248 if (!time.isFinite())
1249 continue;
1249 if (condition.m_beginOrEnd == Begin) 1250 if (condition.m_beginOrEnd == Begin)
1250 addBeginTime(elapsed(), time); 1251 addBeginTime(elapsed(), time);
1251 else 1252 else
1252 addEndTime(elapsed(), time); 1253 addEndTime(elapsed(), time);
1253 } 1254 }
1254 } 1255 }
1255 } 1256 }
1256 1257
1257 void SVGSMILElement::addSyncBaseDependent(SVGSMILElement* animation) 1258 void SVGSMILElement::addSyncBaseDependent(SVGSMILElement* animation)
1258 { 1259 {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 if (eventType == "repeatn") { 1305 if (eventType == "repeatn") {
1305 unsigned repeatEventCount = m_repeatEventCountList.first(); 1306 unsigned repeatEventCount = m_repeatEventCountList.first();
1306 m_repeatEventCountList.remove(0); 1307 m_repeatEventCountList.remove(0);
1307 dispatchEvent(RepeatEvent::create(eventType, repeatEventCount)); 1308 dispatchEvent(RepeatEvent::create(eventType, repeatEventCount));
1308 } else { 1309 } else {
1309 dispatchEvent(Event::create(eventType)); 1310 dispatchEvent(Event::create(eventType));
1310 } 1311 }
1311 } 1312 }
1312 1313
1313 } 1314 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/animations/smil-syncbase-self-dependency-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698