Message ID | tencent_C37E2EAD8E38C9C029B40069B202F9698E0A@qq.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,01/10] avformat/hls: fix repeated requests for media init section | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/libavformat/hls.c b/libavformat/hls.c index 3ed6007d0d..65937120d5 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -225,13 +225,18 @@ typedef struct HLSContext { HLSCryptoContext crypto_ctx; } HLSContext; +static void free_segment(struct segment *segment) { + av_free(segment->key); + av_free(segment->url); + av_free(segment); +} + static void free_segment_dynarray(struct segment **segments, int n_segments) { int i; for (i = 0; i < n_segments; i++) { - av_freep(&segments[i]->key); - av_freep(&segments[i]->url); - av_freep(&segments[i]); + free_segment(segments[i]); + segments[i] = NULL; } }