lavf/segment: remove duplicated and inconsistent cleanup code in seg_write_packet()
In particular, avoid to leave around the seg->avf pointer to freed
structure, and fix crash with:
ffmpeg -f lavfi -i testsrc -c:v h264 -map 0 -f segment foo-%d.ts
(cherry picked from commit 169065fbfb
)
Found-by: Qinghao Tang
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:

committed by
Michael Niedermayer

parent
ca39fbe14d
commit
43b601d36f
@@ -718,12 +718,6 @@ fail:
|
|||||||
if (pkt->stream_index == seg->reference_stream_index)
|
if (pkt->stream_index == seg->reference_stream_index)
|
||||||
seg->frame_count++;
|
seg->frame_count++;
|
||||||
|
|
||||||
if (ret < 0) {
|
|
||||||
if (seg->list)
|
|
||||||
avio_close(seg->list_pb);
|
|
||||||
avformat_free_context(oc);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user