Commit 178eebd7 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

mpegts: handle AVMEDIA_TYPE_UNKNOWN correctly

It is negative, so can't be used for left shifting.

This fixes ubsan runtime error: shift exponent -1 is negative
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent f5495c97
......@@ -2353,7 +2353,8 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
int types = 0;
for (i = 0; i < ts->stream->nb_streams; i++) {
AVStream *st = ts->stream->streams[i];
types |= 1<<st->codecpar->codec_type;
if (st->codecpar->codec_type >= 0)
types |= 1<<st->codecpar->codec_type;
}
if ((types & (1<<AVMEDIA_TYPE_AUDIO) && types & (1<<AVMEDIA_TYPE_VIDEO)) || pos > 100000) {
av_log(ts->stream, AV_LOG_DEBUG, "All programs have pmt, headers found\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment