Skip to content

Commit

Permalink
[GStreamer] Passing unexpected value type to g_object_set() leads to …
Browse files Browse the repository at this point in the history
…buffer over-read

https://bugs.webkit.org/show_bug.cgi?id=246334

Reviewed by Philippe Normand.

Arrange to pass values of the correct size through the g_object_set()
varargs when configuring the videorate GStreamer element.

Bug found by Bastian Krause, who also suggested the fix.

* Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
(WebCore::GStreamerVideoCapturer::createConverter): Use literal TRUE to
set the "drop-only" property of the videorate element, and the UINT64_C
macro from the standard library to provide a 64-bit unsigned literal for
the "average-period".

Canonical link: https://commits.webkit.org/255427@main
  • Loading branch information
aperezdc committed Oct 12, 2022
1 parent e8d22a2 commit 5964f4b
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -73,7 +73,7 @@ GstElement* GStreamerVideoCapturer::createConverter()
auto* videorate = makeGStreamerElement("videorate", "videorate");

// https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/97#note_56575
g_object_set(videorate, "drop-only", 1, "average-period", 1, nullptr);
g_object_set(videorate, "drop-only", TRUE, "average-period", UINT64_C(1), nullptr);

gst_bin_add_many(GST_BIN_CAST(bin), videoscale, videoconvert, videorate, nullptr);

Expand Down

0 comments on commit 5964f4b

Please sign in to comment.