mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
tsmux: catch alloc failure
While it will probably not trigger, it should silence a Coverity warning about the fail code path testing for NULLness before freeing, where the buffer was already dereferenced. It seems safest to keep that test, in case future goto fail statements happen to have a NULL buffer there. Coverity 1139851
This commit is contained in:
parent
c78edf5afc
commit
d347809a82
1 changed files with 3 additions and 1 deletions
|
@ -848,7 +848,7 @@ tsmux_section_write_packet (GstMpegTsSectionType * type,
|
|||
GstBuffer *section_buffer;
|
||||
GstBuffer *packet_buffer = NULL;
|
||||
GstMemory *mem;
|
||||
guint8 *packet;
|
||||
guint8 *packet = NULL;
|
||||
guint8 *data;
|
||||
gsize data_size = 0;
|
||||
gsize payload_written;
|
||||
|
@ -882,6 +882,8 @@ tsmux_section_write_packet (GstMpegTsSectionType * type,
|
|||
while (section->pi.stream_avail > 0) {
|
||||
|
||||
packet = g_malloc (TSMUX_PACKET_LENGTH);
|
||||
if (!packet)
|
||||
goto fail;
|
||||
|
||||
if (section->pi.packet_start_unit_indicator) {
|
||||
/* Wee need room for a pointer byte */
|
||||
|
|
Loading…
Reference in a new issue