Skip to content

Commit

Permalink
mpegts-mythtv.c: fix double free aborts with MHEG streams
Browse files Browse the repository at this point in the history
add_section_stream reused the SectionContext if it already exists.
However, it is assigned to AVStream.priv_data which then results in
double frees causing aborts since multiple streams are created for
the same PID.

The similar add_pes_stream does not reuse its PESContexts.
  • Loading branch information
ulmus-scott authored and bennettpeter committed Aug 15, 2022
1 parent ad9fb22 commit 8bc947b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c
Expand Up @@ -2478,13 +2478,7 @@ static SectionContext *add_section_stream(MpegTSContext *ts, int pid, int stream
MpegTSFilter *tss = ts->pids[pid];
SectionContext *sect = 0;
if (tss) { /* filter already exists */
if (tss->type == MPEGTS_SECTION)
sect = (SectionContext*) tss->u.section_filter.opaque;

if (sect && (sect->stream_type == stream_type))
return sect; /* if it's the same stream type, just return ok */

/* otherwise, kill it, and start a new stream */
/* kill it, and start a new stream */
mpegts_close_filter(ts, tss);
}

Expand Down

0 comments on commit 8bc947b

Please sign in to comment.