]> git.sesse.net Git - ffmpeg/commit - libavformat/movenc.c
avformat/movenc: Fix segfault when remuxing rtp hint stream
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 29 Sep 2020 08:21:34 +0000 (10:21 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 4 Oct 2020 21:38:43 +0000 (23:38 +0200)
commit22c3cd176079dd104ec7610ead697235b04396f1
tree726dd437d44a9913bec1e8ca4b592483ea977ff0
parent6770057ac97e78c799f06eb3769fecdb0833d44f
avformat/movenc: Fix segfault when remuxing rtp hint stream

When remuxing an rtp hint stream (or any stream with the tag "rtp "),
the mov muxer treats this as one of the rtp hint tracks it creates
internally when ordered to do so; yet this track lacks the
AVFormatContext for the hinting rtp muxer, leading to segfaults in
mov_write_udta_sdp() if a "trak" atom is written for this stream; if not,
the stream's codecpar is freed by mov_free() as if the mov muxer owned
it (it does for the internally created "rtp " tracks), but without
resetting st->codecpar, leading to double-frees lateron. This commit
therefore ignores said tag which makes rtp hint streams unremuxable.

This fixes tickets #8181 and #8186.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/movenc.c