Skip to content

Commit

Permalink
mpegts: Make sure we don't return uninitialized packets
Browse files Browse the repository at this point in the history
This fixes crashes, where the demuxer could return 0 even if the returned AVPacket isn't initialized at all. This could happen if running into EOF or running out of probesize with non-seekable sources.

From FFmpeg commit df8aa45
  • Loading branch information
jyavenard committed Jul 16, 2013
1 parent 0a783d2 commit 2ea63fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c
Expand Up @@ -2930,6 +2930,7 @@ static int mpegts_read_packet(AVFormatContext *s,
MpegTSContext *ts = s->priv_data;
int ret, i;

pkt->size = -1;
ts->pkt = pkt;
ret = handle_packets(ts, 0);
if (ret < 0) {
Expand All @@ -2948,6 +2949,8 @@ static int mpegts_read_packet(AVFormatContext *s,
}
}

if (!ret && pkt->size < 0)
ret = AVERROR(EINTR);
return ret;
}

Expand Down

0 comments on commit 2ea63fc

Please sign in to comment.