summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-06-17gst: don't use volatile to mean atomic1.16Matthew Waters12-21/+21
volatile is not sufficient to provide atomic guarantees and real atomics should be used instead. GCC 11 has started warning about using volatile with atomic operations. https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719 Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1012>
2021-03-15matroskademux: Fix extraction of multichannel WavPackSebastian Dröge2-46/+55
The old code had a couple of issues that all lead to potential memory safety bugs. - Use a constant for the Wavpack4Header size instead of using sizeof. It's written out into the data and not from the struct and who knows what special alignment/padding requirements some C compilers have. - gst_buffer_set_size() does not realloc the buffer when setting a bigger size than allocated, it only allows growing up to the maximum allocated size. Instead use a GstAdapter to collect all the blocks and take out everything at once in the end. - Check that enough data is actually available in the input and otherwise handle it an error in all cases instead of silently ignoring it. Among other things this fixes out of bounds writes because the code assumed gst_buffer_set_size() can grow the buffer and simply wrote after the end of the buffer. Thanks to Natalie Silvanovich for reporting. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/859 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/904>
2021-03-15matroskademux: Initialize track context out parameter to NULL before parsingSebastian Dröge1-0/+2
Various error return paths don't set it to NULL and callers are only checking if the pointer is NULL. As it's allocated on the stack this usually contains random stack memory, and more often than not the memory of a previously parsed track. This then causes all kinds of memory corruptions further down the line. Thanks to Natalie Silvanovich for reporting. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/858 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/904>
2020-10-21Release 1.16.31.16.3Tim-Philipp Müller6-63/+840
2020-10-21Update docsTim-Philipp Müller72-73/+73
2020-10-21Update translationsTim-Philipp Müller5-1076/+1010
2020-10-20Automatic update of common submoduleTim-Philipp Müller2-53/+52
From 59cb678 to a825d27
2020-09-28rtpjitterbuffer: fix item freeing for 1.16 branchTim-Philipp Müller3-1/+20
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/739>
2020-09-28rtpjitterbuffer: Properly free internal packets queue in finalize()Sebastian Dröge2-15/+18
As we override the GLib item with our own structure, we cannot use any function from GList or GQueue that would try to free the RTPJitterBufferItem. In this patch, we move away from g_queue_new() which forces using g_queue_free(). This this function could use g_slice_free() if there is any items left in the queue. Passing the wrong size to GSLice may cause data corruption and crash. A better approach would be to use a proper intrusive linked list implementation but that's left as an exercise for the next person running into crashes caused by this. Be ware that this regression was introduced 6 years ago in the following commit [0], the call to flush() looked useless, as there was a g_queue_free() afterward. Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> [0] https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/commit/479c7642fd953edf1291a0ed4a3d53618418019c Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/739>
2020-09-28v4l2videodec: Increase internal bitstream pool sizeNicolas Dufresne1-1/+4
This patch will now set the maximum of buffers to 32, allowing to grow the pool for drivers that supports that and will respect the minimum buffers reported by the driver. This was made to fix a stall with the virtio CODEC driver. Fixes #672 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/738>
2020-09-27rtspsrc: Don't return TRUE for unhandled querySeungha Yang1-2/+3
Expected return value for unhandled query is FALSE Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/752>
2020-09-27rtspsrc: Avoid stack overflow recursing waiting for responseThibault Saunier1-5/+8
Instead of recursing, simply implement a loop with gotos, the same way it was done before 812175288769d647ed6388755aed386378d9210c Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/710 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/751>
2020-09-27rtpbin: fix shutdown crash in rtpbinHavard Graff2-13/+76
The key is to make sure the jitterbuffer is set to NULL *before* the ptdemux. The race that existed would basically happen when ptdemux had reached READY, and the jitterbuffer would then push a buffer, triggering a new pad with a new payloadtype being added and ghosted to the rtpbin itself. However, the srcpad of the ptdemux would now be inactive, and all the sticky-event pushed on it would be swallowed, not allowing any to reach the ghost-pad. Then the buffer in-flight would come to the ghostpad, and we would assert that a buffer arrived before the necessary events. By simply re-ordering the state-changes, we ensure that there will be no buffer racing into the ptdemux while its state is being changed, and the problem disappears completely. Notice also that there is not point in disconnecting the signals on the ptdemux before this point, since we need the push-thread to settle down before we can do this in a non-racy way. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/443>
2020-09-25jpegdec: check buffer size before dereferencing. Fixes #541Jérôme Laheurte1-0/+2
Some cameras (Panacast) have buggy drivers/firmware which send invalid JPEG frames, containing no data, which makes jpegdec crash because it assumes the frame is at least 2 bytes long. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/750>
2020-09-25qtdemux: fix allocation explosion with stsd entriesJustin Chadwell2-1/+56
Previously, the user input for stsd entries is trusted completely, and so a maliciously crafted file could choose the length of the stsd entries arbitrarily and cause qtdemux to try to allocate up to 2GB of memory (half of a 32 bit max int). This patch fixes this by sanity checking the stsd input against the size of the entire stsd atom. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/749>
2020-09-25qtdemux: fix crashes when input stream contained no stsd entriesJustin Chadwell2-0/+54
During trak parsing, we need to check for the existence of stsd_entries, otherwise, we end up with a NULL pointer to them. It is entirely possible for the stsd to exist, but for it to have no entries, which the previous checks did not take into account. This patch adds a simply check to ensure that all files that do not contain a stsd entry are deemed corrupt, and adds a test case to prevent a regression. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/749>
2020-09-25flacenc: Pass audio info from set_format() to query_total_samples() explicitlySebastian Dröge1-4/+3
This fixes writing of the seek table header. gst_audio_encoder_get_audio_info() will still return old/unset audio info until set_format() has actually returned, which then results in query_total_samples() to always return 0. Thanks to Jacob Kauffmann for debugging this and finding the main cause. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/756 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/748>
2020-09-25pulse: fix discovery of newly added devicesGuillaume Desmottes1-2/+0
Fix regression introduced in 7bc5e28d85992b03e5852879b8d4d96043496caf preventing the device provider to send the device-added message for new devices. By early returning the patch was discarding add/remove events. Fix #735 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/747>
2020-09-25Use gst_element_class_set_metadata when passing dynamic stringsJordan Petridis2-2/+2
gst_element_class_set_metadata is meant to only be used with static or inlined strings, which isn't the case for the 2 elements here resulting in use-after-free later on. https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c#gst_element_class_set_static_metadata Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/746>
2020-09-25speex: Fix crash on Windows caused by cross-CRT issueSeungha Yang2-2/+3
Use speex_header_free() to free memory which was allocated by library. Cross-CRT issue should not happen on 1.17 Cerbero build but might happen custom build or so. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/745>
2020-09-25rtspsrc: Use the correct type for storing the max-rtcp-rtp-time-diff propertySebastian Dröge1-1/+1
It's an integer property and rtpbin also expects an integer. Passing it as a GstClockTime (guint64) to g_object_set() will cause problems, and on big endian MIPS apparently causes crashes. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/737 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/744>
2020-09-25rtspsrc: Error out when failling to receive message responseThibault Saunier1-0/+18
And let it rety twice. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/717 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/743>
2020-09-25deinterlace: Force renegotiation when changing modeJan Schmidt1-8/+18
Switching the deinterlacing mode on-the-fly from disabled to auto used to work, but was broken by commit #1f21747c some years ago. Force re-negotiation with downstream when the mode or fields properties are changed, otherwise deinterlace never switches out of the passthrough mode. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/742>
2020-09-25slitmuxsrc: Properly stop the loop if not part reader is presentEdward Hervey1-0/+4
Previously this would end up in a refcounting loop of hell. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/741>
2020-09-25qtdemux: Add 'mp3 ' fourcc that VLC seems to produce nowOlivier Crête2-0/+2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/740>
2020-09-25jack: Use jack_free(3) to release portsokuoku2-5/+5
Port objects acquired with jack_get_ports() need to be freed with jack_free(3), not stdlib free(). On Windows, Jack may be linked against different libc than GStreamer libraries so free()ing port objects directly might cause crash because of libc mismatch. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/737>
2020-06-07flacparse: fix broken reordering of flac metadataJennifer Berringer1-12/+16
Each FLAC metadata block starts with a flag denoting whether it is the last metadata block. The existing flacparse code moves any existing VORBISCOMMENT block to immediately follow the STREAMINFO block without changing any block's last-metadata-block flag. If no VORBISCOMMENT block exists, it created one with the last-metadata-block flag set to true. This results in gstflacdec sometimes giving bad headers to libflac when trying to play perfectly valid FLAC files depending on the file's metadata ordering. Depending on the contents of the other metadata blocks, current versions of libflac may or may not return FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER when given this broken metadata. This is most noticeable with files that have a large cover art image attached where VORBISCOMMENT is the very last metadata block with no PADDING afterwards. This patch changes that behavior so that: 1. For FLAC files that already have a VORBISCOMMENT block, the metadata order is preserved. 2. For FLAC files that do not have a VORBISCOMMENT block, the generated dummy VORBISCOMMENT is placed immediately after STREAMINFO and inherits the last-metadata-block flag from STREAMINFO. https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/484
2020-06-07rtpsession: rename RTCP threadNicolas Pernas Maradei1-1/+1
RTP session starts a new thread for RTCP and names it "rtpsession-rtcp-thread" which happens to be longer than the maximum 16B allowed by pthread_setname_np and causes the naming to fail. See docs for more details. This commit simply shortens the thread's name so it can actually be set.
2020-03-13tests: rtp-payloading: add minimal vp8/vp9 rtp payloading/depayloading testTim-Philipp Müller1-0/+52
2020-03-13rtpvp8pay, rtpvp9pay: fix caps leak in set_caps()Stian Selnes2-0/+2
2020-03-13videomixer: Don't leak peer capsEdward Hervey1-0/+3
2020-02-10rtspsrc: Fix for segmentation fault when handling set/get_parameter requestsAlexander Lapajne1-1/+7
gstrtspsrc uses a queue, set_get_param_q, to store set param and get param requests. The requests are put on the queue by calling get_parameters() and set_parameter(). A thread which executs in gst_rtspsrc_thread() then pops requests from the queue and processes them. The crash occured because the queue became empty and a NULL request object was then used. The reason that the queue became empty is that it was popped even when the thread was NOT processing a get parameter or set parameter command. The fix is to make sure that the queue is ONLY popped when the command being processed is a set parameter or get parameter command.
2020-02-08v4l2: map GST_VIDEO_FORMAT_BGR15Guillaume Desmottes1-0/+4
The GstVideoFormat to v4l2 conversion was missing for BGR15.
2020-02-08v4l2: fix crash on invalid capsGuillaume Desmottes1-0/+3
gst_v4l2_object_set_format_full() was returning FALSE without setting an error. Caller code (gst_v4l2src_fixate()) was then derefing a NULL pointer when trying to handle the error.
2020-02-04vp8enc/vp8enc: set 1 for the default value of VP8E_SET_STATIC_THRESHOLDJulien Isorce1-3/+6
In Google webrtc, the setting VP8E_SET_STATIC_THRESHOLD is set to 1 (except when the content is known to be static very often in which case it is set to 100, i.e. when sharing screen with Google Hangouts). The cpu usage drops a lot when using 1 for above setting because it allows the encoder to skip static/low content blocks. The current 0 default value uses too much cpu and confuses the user regarding the cpu usage expectations. User expects vp8enc to use low cpu by default. Documentation of VP8E_SET_STATIC_THRESHOLD: https://github.com/webmproject/libvpx/blob/master/vpx/vp8cx.h#L188 chromium/webrtc: https://chromium.googlesource.com/external/webrtc/+/b484ec0082948ae086c2ba4142b4d2bf8bc4dd4b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc#822 Closes #58
2020-02-04jpegdec: Check return value of gst_buffer_map()Nicolas Dufresne1-1/+10
Without this check, the element will crash instead of returning an error.
2020-01-14wavenc: Fix writing of the channel mask with >2 channelsSebastian Dröge1-1/+1
The channel position is an enum but the conversion code assumed it's a mask. Convert accordingly.
2020-01-07videocrop: allow properties to be animated by GstControllerDaniel Molkentin1-4/+25
2019-12-06rtpjpegdepay: outputs framed jpegTim-Philipp Müller1-3/+4
Add parsed=true to output caps, as we always output whole frames, timestamped and all. Means also that the output can be decoded by avdec_mjpeg wihout plugging an extra parser (which has no rank).
2019-12-06qtdemux: Specify REDIRECT information in error messageThibault Saunier2-8/+26
There are in the wild (mp4) streams that basically contain no tracks but do have a redirect info[0], in which case, we won't be able to expose any pad (there are no tracks) so we can't post anything but an error on the bus, as: - it can't send EOS downstream, it has no pad, - posting an EOS message will be useless as PAUSED state can't be reached and there is no sink in the pipeline meaning GstBin will simply ignore it The approach here is to to add details to the ERROR message with a `redirect-location` field which elements like playbin handle and use right away. [0]: http://movietrailers.apple.com/movies/paramount/terminator-dark-fate/terminator-dark-fate-trailer-2_480p.mov
2019-12-03Release 1.16.21.16.2Tim-Philipp Müller6-21/+447
2019-12-03Update docsTim-Philipp Müller72-77/+77
2019-12-03Update translationsTim-Philipp Müller1-99/+160
2019-12-02rtpL16depay: don't crash if data is not modulo channels*widthHavard Graff1-2/+14
2019-11-29vp9dec: Fix broken 4:4:4 8bits decodingSeungha Yang1-2/+5
VPX_IMG_FMT_I444 pixel format with sRGB colorspace means GBR data. Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/651
2019-11-29rtpsession: add locking for clear-pt-mapHavard Graff2-0/+46
...or it will segfault from time to time...
2019-11-20wavparse: Fix push mode ignoring audio with a size smaller than segment bufferAmr Mahdi1-3/+3
In push mode (streaming), if the audio size is smaller than segment buffer size, it would be ignored. This happens because when the plugin receives an EOS signal while a single audio chunk that is less than the segment buffer size is buffered, it does not flush this chunk. The fix is to flush the data chunk when it receives an EOS signal and has a single (first) chunk buffered. How to reproduce: 1. Run gst-launch with tcp source ``` gst-launch-1.0 tcpserversrc port=3000 ! wavparse ignore-length=0 ! audioconvert ! filesink location=bug.wav ``` 2. Send a wav file with unspecified data chunk length (0). Attached a test file ``` cat test.wav | nc localhost 3000 ``` 3. Compare the length of the source file and output file ``` ls -l test.wav bug.wav -rw-rw-r-- 1 amr amr 0 Aug 15 11:07 bug.wav -rwxrwxr-x 1 amr amr 3564 Aug 15 11:06 test.wav ``` The expected length of the result of the gst-lauch pipeline should be the same as the test file minus the headers (44), which is ```3564 - 44 = 3520``` but the actual output length is ```0``` After the fix: ``` ls -l test.wav fix.wav -rw-rw-r-- 1 amr amr 3520 Aug 15 11:09 fix.wav -rwxrwxr-x 1 amr amr 3564 Aug 15 11:06 test.wav ```
2019-11-20wavparse: Fix ignoring of last chunk in push modeAmr Mahdi1-7/+18
In push mode (streaming), if the last audio payload chunk is less than the segment rate buffer size, it would be ignored since the plugin waits until it has at least segment rate bufer size of audio. The fix is to introduce a flushing flag that indicates that no more audio will be available so that the plugin can recognize this condition and flush the data is has even if it is less than the desired segment rate buffer size.
2019-11-20v4l2bufferpool: Queue number of allocated buffers to captureNicolas Dufresne2-2/+6
Before we do streamon, we queue all capture buffers by calling resurrect. When the driver supports CREATE_BUFS, this would lead to buffers being allocated till the maximum of 32 is reached. Instead, we now save the number of allocated buffers and queue this amount.
2019-11-19v4l2object: Workaround bad TRY_FMT colorimetry implementationNicolas Dufresne1-6/+14
libv4l2 reset the colorpace to 0 and does not do any request to the driver. This yields an invalid colorspace which currently cause a negotiation failure. This workaround by ignoring bad values during the TRY_FMT step.