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 774959 - rtpbuffer: fix ensure_buffers
rtpbuffer: fix ensure_buffers
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.8.3
Other Linux
: Normal normal
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-23 19:19 UTC by Miguel París Díaz
Modified: 2016-11-26 22:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtpbuffer: fix ensure_buffers (2.47 KB, patch)
2016-11-23 19:19 UTC, Miguel París Díaz
none Details | Review
rtpbuffer: fix ensure_buffers (2.50 KB, patch)
2016-11-23 21:09 UTC, Miguel París Díaz
none Details | Review
rtpbuffer: fix ensure_buffers (2.53 KB, patch)
2016-11-24 13:54 UTC, Miguel París Díaz
none Details | Review
rtpbuffer: fix ensure_buffers (2.53 KB, patch)
2016-11-25 09:59 UTC, Miguel París Díaz
committed Details | Review

Description Miguel París Díaz 2016-11-23 19:19:07 UTC
Created attachment 340638 [details] [review]
rtpbuffer: fix ensure_buffers

I have noticed that when gst_rtp_buffer_add_extension_onebyte_header is used over a GstRtpBuffer that only contains a memory for the whole packet, ensure_buffers function crashes at the next point:

mem = gst_memory_copy (rtp->map[i].memory, offset, rtp->size[i]);

when i==2 because the payload is not mapped.

In addition the offset is calculated subtracting in the wrong direction.

The attached patch fixes these issues.
Comment 1 Miguel París Díaz 2016-11-23 21:09:17 UTC
Created attachment 340646 [details] [review]
rtpbuffer: fix ensure_buffers
Comment 2 Miguel París Díaz 2016-11-24 13:54:06 UTC
Created attachment 340684 [details] [review]
rtpbuffer: fix ensure_buffers

Improve performance only mapping payload when is not mapped yet.
Comment 3 Miguel París Díaz 2016-11-25 09:59:38 UTC
Created attachment 340740 [details] [review]
rtpbuffer: fix ensure_buffers

Fix previous patch
Comment 4 Sebastian Dröge (slomo) 2016-11-25 11:16:40 UTC
commit 036bdf5d2d44facdcf4116ac90d3df29cbd96b8d
Author: Miguel Paris <mparisparis@gmail.com>
Date:   Fri Nov 25 10:48:06 2016 +0100

    rtpbuffer: Fix ensure_buffers() if whole packet is in one GstMemory
    
    When gst_rtp_buffer_add_extension_onebyte_header() is used over a
    GstRtpBuffer that only contains a memory for the whole packet,
    ensure_buffers function crashes at the next point:
    
    mem = gst_memory_copy (rtp->map[i].memory, offset, rtp->size[i]);
    
    when i==2 because the payload is not mapped.
    
    In addition the offset is calculated subtracting in the wrong direction.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774959
Comment 5 Sebastian Dröge (slomo) 2016-11-25 11:17:25 UTC
Please write proper commit messages in the future :)
Comment 6 Miguel París Díaz 2016-11-26 22:36:05 UTC
OK
thanks @slomo ;)