[vlc-commits] [Git][videolan/vlc][master] 3 commits: sout: hls: fix leaking error handling

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Aug 31 12:58:51 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
57f04c8b by Alaric Senat at 2023-08-31T12:21:43+00:00
sout: hls: fix leaking error handling

The vector needs to be released before the potential early return.

- - - - -
87cab309 by Alaric Senat at 2023-08-31T12:21:43+00:00
sout: hls: use the correct `size_t` format identifier

- - - - -
3962ac19 by Alaric Senat at 2023-08-31T12:21:43+00:00
sout: hls: only drain the deleted playlist

The previous code was badly implemented. Only the HLS playlist that was
just removed needs to be drained and have its manifest updated.

- - - - -


1 changed file:

- modules/stream_out/hls/hls.c


Changes:

=====================================
modules/stream_out/hls/hls.c
=====================================
@@ -261,10 +261,10 @@ static char *GeneratePlaylistCodecInfo(const struct vlc_list *media_list,
         return NULL;
     return out.ptr;
 error:
+    vlc_vector_destroy(&already_described);
     if (vlc_memstream_close(&out) != 0)
         return NULL;
     free(out.ptr);
-    vlc_vector_destroy(&already_described);
     return NULL;
 }
 
@@ -476,7 +476,7 @@ static ssize_t AccessOutWrite(sout_access_out_t *access, block_t *block)
             playlist->config->max_memory)
         {
             vlc_error(playlist->logger,
-                      "Maximum memory capacity (%luKb) for segment storage was "
+                      "Maximum memory capacity (%zuKb) for segment storage was "
                       "reached. The HLS server will stop creating segments. "
                       "Please refer to the max-memory option for more info.",
                       BYTES_TO_KB(playlist->config->max_memory));
@@ -776,12 +776,9 @@ static void Del(sout_stream_t *stream, void *id)
         if (map != NULL)
             map->playlist_ref = NULL;
 
-        hls_playlist_t *playlist;
-        hls_playlists_foreach (playlist)
-            ExtractAndAddSegment(playlist, sys->config.segment_length);
-
-        playlist->ended = true;
-        UpdatePlaylistManifest(playlist);
+        track->playlist_ref->ended = true;
+        ExtractAndAddSegment(track->playlist_ref, sys->config.segment_length);
+        UpdatePlaylistManifest(track->playlist_ref);
 
         DeletePlaylist(track->playlist_ref);
     }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/998b623df50ed3ca7a6296e3bfd2808ffcaf50a8...3962ac19d0681ba88a64364e5825f3041a94a53f

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


VideoLAN code repository instance


More information about the vlc-commits mailing list