2008-04-17 Eric Carlson <eric.carlson@apple.com>
authoradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Apr 2008 20:26:41 +0000 (20:26 +0000)
committeradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Apr 2008 20:26:41 +0000 (20:26 +0000)
        Reviewed by Adele.

        Fix for <rdar://problem/5861642> QTMovieWin returns uninitialized values

        * platform/graphics/win/QTMovieWin.cpp:
        (QTMovieWin::rate):
        (QTMovieWin::setRate):
        (QTMovieWin::setVolume):
        (QTMovieWin::getNaturalSize):

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

WebCore/ChangeLog
WebCore/platform/graphics/win/QTMovieWin.cpp

index 917f279..e3aba23 100644 (file)
@@ -1,3 +1,15 @@
+2008-04-17 Eric Carlson  <eric.carlson@apple.com> 
+
+        Reviewed by Adele. 
+
+        Fix for <rdar://problem/5861642> QTMovieWin returns uninitialized values
+
+        * platform/graphics/win/QTMovieWin.cpp:
+        (QTMovieWin::rate):
+        (QTMovieWin::setRate):
+        (QTMovieWin::setVolume):
+        (QTMovieWin::getNaturalSize):
+
 2008-04-17  Marco Barisione  <marco.barisione@collabora.co.uk>
 
         Reviewed by Alp Toker.
 2008-04-17  Marco Barisione  <marco.barisione@collabora.co.uk>
 
         Reviewed by Alp Toker.
index 80c6d50..31e78d6 100644 (file)
@@ -320,11 +320,15 @@ void QTMovieWin::pause()
 
 float QTMovieWin::rate() const
 {
 
 float QTMovieWin::rate() const
 {
+    if (!m_private->m_movie)
+        return 0;
     return FixedToFloat(GetMovieRate(m_private->m_movie));
 }
 
 void QTMovieWin::setRate(float rate)
 {
     return FixedToFloat(GetMovieRate(m_private->m_movie));
 }
 
 void QTMovieWin::setRate(float rate)
 {
+    if (!m_private->m_movie)
+        return;
     SetMovieRate(m_private->m_movie, FloatToFixed(rate));
     updateTaskTimer();
 }
     SetMovieRate(m_private->m_movie, FloatToFixed(rate));
     updateTaskTimer();
 }
@@ -359,6 +363,8 @@ void QTMovieWin::setCurrentTime(float time) const
 
 void QTMovieWin::setVolume(float volume)
 {
 
 void QTMovieWin::setVolume(float volume)
 {
+    if (!m_private->m_movie)
+        return;
     SetMovieVolume(m_private->m_movie, static_cast<short>(volume * 256));
 }
 
     SetMovieVolume(m_private->m_movie, static_cast<short>(volume * 256));
 }
 
@@ -385,8 +391,10 @@ long QTMovieWin::loadState() const
 
 void QTMovieWin::getNaturalSize(int& width, int& height)
 {
 
 void QTMovieWin::getNaturalSize(int& width, int& height)
 {
-    Rect rect;
-    GetMovieNaturalBoundsRect(m_private->m_movie, &rect);
+    Rect rect = { 0, };
+
+    if (m_private->m_movie)
+        GetMovieNaturalBoundsRect(m_private->m_movie, &rect);
     width = rect.right;
     height = rect.bottom;
 }
     width = rect.right;
     height = rect.bottom;
 }