On Sat, Jan 02, 2016 at 05:12:13PM +0100, Andreas Cadhalpun wrote: > On 02.01.2016 16:56, Nicolas George wrote: > > Le tridi 13 nivôse, an CCXXIV, Andreas Cadhalpun a écrit : > >> This fixes ubsan runtime error: left shift by 8 places cannot be > >> represented in type 'int' > >> > >> Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> > >> --- > >> libavformat/ffmdec.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c > >> index 7b2d0d7..3162354 100644 > >> --- a/libavformat/ffmdec.c > >> +++ b/libavformat/ffmdec.c > >> @@ -76,7 +76,7 @@ static int ffm_resync(AVFormatContext *s, int state) > >> av_log(s, AV_LOG_ERROR, "cannot find FFM syncword\n"); > >> return -1; > >> } > >> - state = (state << 8) | avio_r8(s->pb); > >> + state = ((unsigned)state << 8) | avio_r8(s->pb); > >> } > >> return 0; > >> } > > > > IMHO, it would be more correct to make state uint32_t (and id at the call > > site possibly too). > > That alternative is fine for me, too. Patch attached. > > Happy new year, > Andreas >
> ffmdec.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > 6c3ca0f947737208725d30a735deaea2a95531ba > 0002-ffmdec-change-type-of-state-and-id-to-unsigned.patch > From a461d6e867aa0b4be7c673d69f1318eff9ffa4d5 Mon Sep 17 00:00:00 2001 > From: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> > Date: Sat, 2 Jan 2016 16:27:43 +0100 > Subject: [PATCH 2/3] ffmdec: change type of state and id to unsigned > > This fixes ubsan runtime error: left shift by 8 places cannot be > represented in type 'int' > > Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Concerning the gods, I have no means of knowing whether they exist or not or of what sort they may be, because of the obscurity of the subject, and the brevity of human life -- Protagoras
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel