Skip to content

Commit

Permalink
mpegts-mythtv.c: new_section_av_stream() fix memory leak
Browse files Browse the repository at this point in the history
revealed by preprocessing MACRO FF_ALLOCZ_OR_GOTO

avformat_new_stream() allocates the returned AVStream.
  • Loading branch information
ulmus-scott authored and bennettpeter committed Aug 15, 2022
1 parent 267d981 commit a5ce4ef
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c
Expand Up @@ -2614,13 +2614,12 @@ static void mpegts_cleanup_streams(MpegTSContext *ts)
static AVStream *new_section_av_stream(SectionContext *sect, enum AVMediaType type,
enum AVCodecID id)
{
sect->st = av_mallocz(sizeof(AVStream));
if (!(sect->st) && (sizeof(AVStream)) != 0) {
sect->st = avformat_new_stream(sect->stream, NULL);
if (!(sect->st)) {
av_log(NULL, AV_LOG_ERROR, "Cannot allocate memory.\n");
return NULL;
}

sect->st = avformat_new_stream(sect->stream, NULL);
sect->st->id = sect->pid;

avpriv_set_pts_info(sect->st, 33, 1, 90000);
Expand Down

0 comments on commit a5ce4ef

Please sign in to comment.