Opened 8 years ago

Closed 8 years ago

#6231 closed defect (fixed)

hls_flags single_file segfault

Reported by: Christian Ebert Owned by: Steven Liu
Priority: important Component: avformat
Version: git-master Keywords: hls regression crash
Cc: blacktrash@gmx.net Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Since 4507f29e4a6a4363e0179c02bdb78d55e4d9a12c hls_flags single_file segfaults.

How to reproduce:

$ ffmpeg -v verbose -i test.mp4 -c copy -map 0 -f hls -hls_flags +single_file test.m3u8
ffmpeg version N-83882-g58f0bbc1ea Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --enable-gpl --enable-nonfree --disable-ffserver --enable-shared --enable-openssl --enable-libspeex --enable-libopus --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libxvid --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libvidstab --extra-cflags=-I/sw/include --extra-libs=-L/sw/lib
  libavutil      55. 48.100 / 55. 48.100
  libavcodec     57. 83.100 / 57. 83.100
  libavformat    57. 66.104 / 57. 66.104
  libavdevice    57.  3.100 / 57.  3.100
  libavfilter     6. 76.100 /  6. 76.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
[h264 @ 0x7ff739808600] Reinit context to 240x400, pix_fmt: yuv420p
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.66.104
  Duration: 00:00:17.79, start: 0.000000, bitrate: 173 kb/s
    Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, smpte170m, left), 226x400 (240x400) [SAR 1:1 DAR 113:200], 141 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 25 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
[mpegts @ 0x7ff739000600] muxrate VBR, pcr every 3 pkts, sdt every 2147483647, pat/pmt every 2147483647 pkts
Output #0, hls, to 'test.m3u8':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.66.104
    Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, smpte170m, left), 226x400 (0x0) [SAR 1:1 DAR 113:200], q=2-31, 141 kb/s, 30 fps, 30 tbr, 90k tbn, 30 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 25 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
Automatically inserted bitstream filter 'h264_mp4toannexb'; args=''
[hls muxer @ 0x7ff73a008a00] EXT-X-MEDIA-SEQUENCE:0
Segmentation fault: 11

Change History (6)

comment:1 by Carl Eugen Hoyos, 8 years ago

Keywords: regression crash added; single_file removed
Priority: normalimportant

comment:2 by Steven Liu, 8 years ago

Owner: set to Steven Liu
Status: newopen

comment:3 by Steven Liu, 8 years ago

comment:4 by Christian Ebert, 8 years ago

Perfect. Thanks.
I saw that the fd was closed too early, after 1 segment, but wasn't sure how to get the conditional right.

in reply to:  4 comment:5 by Steven Liu, 8 years ago

Replying to blacktrash:

Perfect. Thanks.
I saw that the fd was closed too early, after 1 segment, but wasn't sure how to get the conditional right.

That because need update the file rename to remove the ".tmp", the rename can success after close file in Windows, so close it.

comment:6 by Steven Liu, 8 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.