<rdar://problem/9304956> media/broken-video.html crashes
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Apr 2011 02:03:37 +0000 (02:03 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Apr 2011 02:03:37 +0000 (02:03 +0000)
Reviewed by Eric Carlson.

* platform/graphics/MediaPlayer.cpp:
(WebCore::nextMediaEngine): Fixed an off-by-one error.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@84452 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/MediaPlayer.cpp

index 776d6b0..902816d 100644 (file)
@@ -1,3 +1,12 @@
+2011-04-20  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Eric Carlson.
+
+        <rdar://problem/9304956> media/broken-video.html crashes
+
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::nextMediaEngine): Fixed an off-by-one error.
+
 2011-04-20  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Adam Barth.
index fbf97ac..05c0e06 100644 (file)
@@ -275,7 +275,7 @@ static MediaPlayerFactory* nextMediaEngine(MediaPlayerFactory* current)
         return engines.first();
 
     size_t currentIndex = engines.find(current);
-    if (currentIndex == WTF::notFound || currentIndex == engines.size()) 
+    if (currentIndex == WTF::notFound || currentIndex + 1 >= engines.size()) 
         return 0;
 
     return engines[currentIndex + 1];