Opened 9 years ago
Closed 9 years ago
#4957 closed defect (fixed)
Crash in libavformat/mux.c when processing a corrupted input stream
Reported by: | Jarda Snajdr | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avformat |
Version: | git-master | Keywords: | crash SIGSEGV regression |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
Summary of the bug:
libavformat/mux.c:compute_pkt_fields2 crashes when trying to set st->priv_pts->val. priv_pts is a NULL pointer.
How to reproduce:
- Download this mpg file: https://www.dropbox.com/s/k6n6yi6f9ngrgxi/stream.mpg?dl=0
- Try to convert it into a HLS playlist+chunks:
% ffmpeg -i stream.mpg -c copy plist.m3u8
The stream.mpg file is an output of mumudvb trying to stream a DVB-T broadcast when the signal strength is poor - the streams are likely seriously corrupted.
Actual result:
ffmpeg crashes. This is the LLDB output:
* thread #1: tid = 0x5d484, 0x000000010017d47f ffmpeg_g`compute_pkt_fields2(s=<unavailable>, st=0x0000000101d11b00, pkt=0x00007fff5fbfaae0) + 1535 at mux.c:560, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x000000010017d47f ffmpeg_g`compute_pkt_fields2(s=<unavailable>, st=0x0000000101d11b00, pkt=0x00007fff5fbfaae0) + 1535 at mux.c:560 557 av_ts2str(pkt->pts), av_ts2str(pkt->dts)); 558 559 st->cur_dts = pkt->dts; -> 560 st->priv_pts->val = pkt->dts; 561 562 /* update pts */ 563 switch (st->codec->codec_type) {
The st->priv_pts field is NULL. It's initialized in avformat_write_header, which probably was never called for the affected stream.
Possible fix - wrap all st->priv_pts access with a null check?
Attachments (1)
Change History (3)
comment:1 by , 9 years ago
Keywords: | crash SIGSEGV regression added |
---|---|
Priority: | normal → important |
Reproduced by developer: | set |
Status: | new → open |
Version: | unspecified → git-master |
by , 9 years ago
Attachment: | stream.mpg added |
---|
comment:2 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
The crash was fixed by Michael in c62d1780fff8a1997dd1707bbc557efc8fe41e3c - see ticket #5067
For future tickets: Please remember to always post all requested information that includes the console output, disassembly and register content.
The crash is a regression since b84232694ef0c6897e82b52326c9ea4027c69ec4