MockRealtimeVideoSource::setFrameRateWithPreset should not use preset after moving it
https://bugs.webkit.org/show_bug.cgi?id=202800

Reviewed by Alexey Proskuryakov.

This does not affect behavior right now since clients typically get the intrinsic size through media samples.
But this could create some inconsistencies.

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::setFrameRateWithPreset):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@250980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 982984b..4b7db5b 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2019-10-10  youenn fablet  <youenn@apple.com>
+
+        MockRealtimeVideoSource::setFrameRateWithPreset should not use preset after moving it
+        https://bugs.webkit.org/show_bug.cgi?id=202800
+
+        Reviewed by Alexey Proskuryakov.
+
+        This does not affect behavior right now since clients typically get the intrinsic size through media samples.
+        But this could create some inconsistencies.
+
+        * platform/mock/MockRealtimeVideoSource.cpp:
+        (WebCore::MockRealtimeVideoSource::setFrameRateWithPreset):
+
 2019-10-10  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Timelines: don't call willDispatchEvent/didDispatchEvent unless there is a listener for the event
diff --git a/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp b/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
index 04ee3b4..9164873d 100644
--- a/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
+++ b/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
@@ -189,8 +189,8 @@
 void MockRealtimeVideoSource::setFrameRateWithPreset(double, RefPtr<VideoPreset> preset)
 {
     m_preset = WTFMove(preset);
-    if (preset)
-        setIntrinsicSize(preset->size);
+    if (m_preset)
+        setIntrinsicSize(m_preset->size);
 }
 
 IntSize MockRealtimeVideoSource::captureSize() const