Opened 9 years ago

Closed 9 years ago

#749 closed defect (fixed)

Apple HTTP Live Streaming segfault

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


Regarding applehttp.c:
If av_probe_input_buffer() fails in applehttp_read_header(), the code jumps to fail, which invokes free_variant_list() which in turn invokes avformat_close_input(), which can cause a segmentation fault if its AVInputFormat has not yet been intialized.

av_probe_input_buffer() can fail when the playlist contains URLs which the underlying TCP code can't connect to. av_probe_input_buffer uses avio_read which invokes read_data->open_input->ffurl_open->ffurl_connect->url_open2-> ... ->tcp_open->connect.

So, if you have a playlist such the one below:

If is not available, ffplay f.e. segfaults.

Change History (2)

comment:1 Changed 9 years ago by michael

you forgot a # before EXTM3U
but either way it doesnt crash, it just exits with Input/output error
i confirmed that ctx->iformat is NULL before the call to avformat_close_input()

comment:2 Changed 9 years ago by michael

  • Resolution set to fixed
  • Status changed from new to closed

Fixed differently by Martin, which should make everyone happy.
I still would be quite interrested to see a case where the simpler solution of just calling avformat_close_input() with the checks inside produces any kind of problem.

Note: See TracTickets for help on using tickets.