After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786670 - vpxenc: Return empty GValueArray instead of NULL in gst_vpx_enc_get_property
vpxenc: Return empty GValueArray instead of NULL in gst_vpx_enc_get_property
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.12.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-23 07:40 UTC by Stefan-Adrian Popa
Modified: 2017-08-26 16:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Return empty GValueArray instead of NULL. (4.01 KB, patch)
2017-08-23 07:43 UTC, Stefan-Adrian Popa
none Details | Review
Return empty GValueArray instead of NULL. (3.92 KB, patch)
2017-08-24 07:22 UTC, Stefan-Adrian Popa
none Details | Review

Description Stefan-Adrian Popa 2017-08-23 07:40:54 UTC
We should return an empty GValueArray instead of NULL in gst_vpx_enc_get_property. Otherwise, we will get a SEGFAULT when calling gst_preset_save_preset() on the encoder. This happens because the gst_value_serialize_g_value_array() function expects a valid GValueArray and not NULL.
Comment 1 Stefan-Adrian Popa 2017-08-23 07:43:28 UTC
Created attachment 358210 [details] [review]
Return empty GValueArray instead of NULL.
Comment 2 Tim-Philipp Müller 2017-08-23 07:59:35 UTC
Or maybe we should fix gst_preset_save_preset() instead?

Andin  your patch it would be better to use _take_boxed() instead of _set_boxed()+_free() :)
Comment 3 Thibault Saunier 2017-08-23 20:54:45 UTC
> Or maybe we should fix gst_preset_save_preset() instead?

Well, first GstValue::serialize should not crash, then fact that it does makes me think vpxenc should not passe NULL as a GValueArray pointer.

We want gst_preset_save_preset to have a serialized empty array, not a reference to a NULL pointer I think.
Comment 4 Stefan-Adrian Popa 2017-08-24 07:22:31 UTC
Created attachment 358298 [details] [review]
Return empty GValueArray instead of NULL.

I uploaded a new patch with _take_boxed() instead of _set_boxed()+_free(). I also think it would be better to fix it here rather than in GstPreset.
Comment 5 Thibault Saunier 2017-08-26 16:52:50 UTC
commit 6a0b0b653e6d99a35fd7463a35fd2e928f4b3abd (HEAD -> 1.12)
Author: Thibault Saunier <thibault.saunier@osg.samsung.com>
Date:   Sat Aug 26 13:44:38 2017 -0300

    value: Handle serializing NULL GValueArray
    
    Consider them as an empty array and do not segfault...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786670