Skip to content

Commit

Permalink
Merge r163871 - [GStreamer] High playback rate causes crash
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=128453

Patch by Piotr Grad <p.grad@samsung.com> on 2014-02-11
Reviewed by Philippe Normand.

Source/WebCore:

To high playback rate passed to GStreamer was causing crash.
Added guard in setRate method.

Test: media/video-extreme-playbackrate-crash.html

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setRate):

LayoutTests:

Test checks if passing high playback rate causes crash.

* media/video-extreme-playbackrate-crash-expected.txt: Added.
* media/video-extreme-playbackrate-crash.html: Added.
  • Loading branch information
Piotr Grad authored and carlosgcampos committed Feb 17, 2014
1 parent 6f17a95 commit b6f7369
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
12 changes: 12 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
2014-02-11 Piotr Grad <p.grad@samsung.com>

[GStreamer] High playback rate causes crash
https://bugs.webkit.org/show_bug.cgi?id=128453

Reviewed by Philippe Normand.

Test checks if passing high playback rate causes crash.

* media/video-extreme-playbackrate-crash-expected.txt: Added.
* media/video-extreme-playbackrate-crash.html: Added.

2014-02-09 Carlos Garnacho <carlosg@gnome.org>

[GTK] Enable touch features
Expand Down
@@ -0,0 +1,6 @@

Test that passing extreme playback rate does not cause crash.

EVENT(canplaythrough)
END OF TEST

25 changes: 25 additions & 0 deletions LayoutTests/media/video-extreme-playbackrate-crash.html
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
function start() {
findMediaElement();
video.src = findMediaFile("video", "content/test");
waitForEventOnce('canplaythrough', canPlayThrough);
}

function canPlayThrough() {
video.playbackRate = 10000000;
video.play();
video.playbackRate = -10000000;
endTest();
}
</script>
</head>
<body onload="start()">
<video></video>
<p>Test that passing extreme playback rate does not cause crash.</p>
</body>
</html>
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2014-02-11 Piotr Grad <p.grad@samsung.com>

[GStreamer] High playback rate causes crash
https://bugs.webkit.org/show_bug.cgi?id=128453

Reviewed by Philippe Normand.

To high playback rate passed to GStreamer was causing crash.
Added guard in setRate method.

Test: media/video-extreme-playbackrate-crash.html

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setRate):

2014-02-10 Carlos Garcia Campos <cgarcia@igalia.com>

[GLIB] Add GUniqueOutPtr and use it instead of GOwnPtr
Expand Down
Expand Up @@ -862,6 +862,9 @@ void MediaPlayerPrivateGStreamer::newTextSample()

void MediaPlayerPrivateGStreamer::setRate(float rate)
{
// Higher rate causes crash.
rate = clampTo(rate, -20, 20);

// Avoid useless playback rate update.
if (m_playbackRate == rate) {
// and make sure that upper layers were notified if rate was set
Expand Down

0 comments on commit b6f7369

Please sign in to comment.