Ticket #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 |
Description
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:
EXTM3U
#EXT-X-TARGETDURATION:60
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:60,
http://172.19.40.153/20111214/stream0q2v1/fileSequence0.ts
If 172.19.40.153 is not available, ffplay f.e. segfaults.
Change History
comment:2 Changed 18 months ago by michael
- Status changed from new to closed
- Resolution set to fixed
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.



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()