Message ID | 13a06398-32cb-c0ac-4135-cfd2321ce671@googlemail.com |
---|---|
State | Accepted |
Commit | 178eebd79e5bf3f4a4471576cd1a48bf9df59e09 |
Headers | show |
On Sat, Oct 22, 2016 at 01:22:21AM +0200, Andreas Cadhalpun wrote: > It is negative, so can't be used for left shifting. > > This fixes ubsan runtime error: shift exponent -1 is negative > > Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> > --- > libavformat/mpegts.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) should be ok thx [...]
On 22.10.2016 11:41, Michael Niedermayer wrote: > On Sat, Oct 22, 2016 at 01:22:21AM +0200, Andreas Cadhalpun wrote: >> It is negative, so can't be used for left shifting. >> >> This fixes ubsan runtime error: shift exponent -1 is negative >> >> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> >> --- >> libavformat/mpegts.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) > > should be ok Pushed. Best regards, Andreas
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 97a2225..cc2addc 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -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");
It is negative, so can't be used for left shifting. This fixes ubsan runtime error: shift exponent -1 is negative Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> --- libavformat/mpegts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)