[vlc-commits] [Git][videolan/vlc][master] 3 commits: Revert "core: remove pointless re-initialisation of `stream_t` attributes"

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu Jan 13 16:01:17 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
f6dad0e9 by Lyndon Brown at 2022-01-13T15:42:21+00:00
Revert "core: remove pointless re-initialisation of `stream_t` attributes"

This reverts commit b10f5a02e1787ce044226094e257ff3449e4c8d8.

as requested in follow-up discussion in !1104.

- - - - -
cb54d4d5 by Lyndon Brown at 2022-01-13T15:42:21+00:00
Revert "stream: remove pointless & incomplete initialisation"

This reverts commit 830ea36e708425d62c04f157705a4d478e01dd07.

as requested in follow-up discussion in !1104.

(actually this is now a partial revert - the change to the return line has
been left in place per review request in !1193).

- - - - -
a9dd4b14 by Lyndon Brown at 2022-01-13T15:42:21+00:00
stream: add missing explicit initialisation

(matching the order of attributes in the struct)

the object is allocated with `calloc()` via `vlc_custom_create()` but
despite this explicit allocation is wanted.

- - - - -


4 changed files:

- src/input/access.c
- src/input/demux.c
- src/input/stream.c
- src/input/stream_fifo.c


Changes:

=====================================
src/input/access.c
=====================================
@@ -103,7 +103,9 @@ static stream_t *access_New(vlc_object_t *parent, input_thread_t *input,
 
     access->p_input_item = input ? input_GetItem(input) : NULL;
     access->out = out;
+    access->psz_name = NULL;
     access->psz_url = strdup(mrl);
+    access->psz_filepath = NULL;
     access->b_preparsing = preparsing;
     priv = vlc_stream_Private(access);
 


=====================================
src/input/demux.c
=====================================
@@ -156,6 +156,11 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_input,
     p_demux->out            = out;
     p_demux->b_preparsing   = b_preparsing;
 
+    p_demux->pf_readdir = NULL;
+    p_demux->pf_demux   = NULL;
+    p_demux->pf_control = NULL;
+    p_demux->p_sys      = NULL;
+
     char *modbuf = NULL;
     bool strict = true;
 
@@ -449,9 +454,16 @@ static demux_t *demux_FilterNew( demux_t *p_next, const char *p_name )
     if (unlikely(p_demux == NULL))
         return NULL;
 
-    p_demux->s = p_next;
-
     priv = vlc_stream_Private(p_demux);
+    p_demux->s            = p_next;
+    p_demux->p_input_item = NULL;
+    p_demux->p_sys        = NULL;
+    p_demux->psz_name     = NULL;
+    p_demux->psz_url      = NULL;
+    p_demux->psz_location = NULL;
+    p_demux->psz_filepath = NULL;
+    p_demux->out          = NULL;
+
     priv->module = module_need(p_demux, "demux_filter", p_name,
                                p_name != NULL);
     if (priv->module == NULL)


=====================================
src/input/stream.c
=====================================
@@ -74,12 +74,34 @@ stream_t *vlc_stream_CustomNew(vlc_object_t *parent,
     if (unlikely(priv == NULL))
         return NULL;
 
+    stream_t *s = &priv->stream;
+
+    s->psz_name = NULL;
+    s->psz_url = NULL;
+    s->psz_location = NULL;
+    s->psz_filepath = NULL;
+    s->b_preparsing = false;
+    s->p_input_item = NULL;
+    s->s = NULL;
+    s->out = NULL;
+    s->pf_read = NULL;
+    s->pf_block = NULL;
+    s->pf_readdir = NULL;
+    s->pf_demux = NULL;
+    s->pf_seek = NULL;
+    s->pf_control = NULL;
+    s->p_sys = NULL;
     assert(destroy != NULL);
     priv->destroy = destroy;
+    priv->block = NULL;
+    priv->peek = NULL;
+    priv->offset = 0;
+    priv->eof = false;
 
     /* UTF16 and UTF32 text file conversion */
     priv->text.conv = (vlc_iconv_t)(-1);
     priv->text.char_width = 1;
+    priv->text.little_endian = false;
 
     return &priv->stream;
 }


=====================================
src/input/stream_fifo.c
=====================================
@@ -123,6 +123,7 @@ vlc_stream_fifo_t *vlc_stream_fifo_New(vlc_object_t *parent, stream_t **reader)
     sys = vlc_stream_Private(s);
     sys->writer = writer;
     s->pf_block = vlc_stream_fifo_Block;
+    s->pf_seek = NULL;
     s->pf_control = vlc_stream_fifo_Control;
     *reader = s;
     return writer;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a7d0549cd214c7ef52b667a1400e938448918861...a9dd4b1452dbea788a7417fcb6def887a14ce82d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a7d0549cd214c7ef52b667a1400e938448918861...a9dd4b1452dbea788a7417fcb6def887a14ce82d
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list