Opened 9 years ago

Closed 9 years ago

#4900 closed defect (fixed)

HLS flag "delete_segments" errors

Reported by: DeHackEd Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: hls
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Using "ffmpeg ... -hls_flags delete_segments ..." will result in corrupted filenames when trying to delete old segments. The output is something like:
[hls muxer @ 0x3c3a2a0] failed to delete old segment : No such file or directory
[hls muxer @ 0x3c3a2a0] failed to delete old segment ,&q'?zh&1[\S: No such file or directory
[hls muxer @ 0x3c3a2a0] failed to delete old segment AjC<?+*<
<j$: No such file or directory

(Non-ASCII characters have been replaced for readability)

How to reproduce:

% ffmpeg -i testvideo.ts -f hls -c:v libx264 -crf 25 -c:a aac -strict -2 -f hls -hls_flags delete_segments test.m3u8

Once sufficient time has passed errors will be printed regularly.

Tested on current git head

I bisected to identify the faulty commit:
379ddc6af44f0c2f3cb517bcc5664610aef9bfc0
avformat/hlsenc: Add WebVtt support in hls

Change History (5)

comment:1 by Carl Eugen Hoyos, 9 years ago

Keywords: regression added; delete_segments removed
Priority: normalimportant

comment:2 by DeHackEd, 9 years ago

Keywords: regression removed
Summary: HLS flag "delete_segments" regressionHLS flag "delete_segments" errors

Turns out to not be a regression, unlinking of segments is working. My mistake.

comment:3 by Carl Eugen Hoyos, 9 years ago

Priority: importantnormal

So what is the issue?

comment:4 by DeHackEd, 9 years ago

When no subtitles are in use segment->sub_filename consists of uninitialized/garbage memory. During segment deletion there is no check for whether sub_filename is valid and it attempts to unlink() regardless. This fails and the uninitialized memory block is also printed via av_log for the failure.

I submitted a possible fix to the mailing list.

comment:5 by Carl Eugen Hoyos, 9 years ago

Resolution: fixed
Status: newclosed

The patch was applied as 76e3f8242d607ac0394b7894196f83f8d02ce5ca
Thank you for the report and the fix!

Note: See TracTickets for help on using tickets.