]> git.sesse.net Git - ffmpeg/commitdiff
avformat/rmdec.c: fix left shift of negative value in rm_sync()
authorJames Almer <jamrial@gmail.com>
Sun, 15 Sep 2019 03:06:34 +0000 (00:06 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 15 Sep 2019 13:31:19 +0000 (10:31 -0300)
Fixes ticket 8143.

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/rmdec.c

index c9abd38d337bcb337cb44a3a5057a78553fe5a10..e95cc9f858c617d5175640e4087fbe6580b6b8bf 100644 (file)
@@ -724,8 +724,8 @@ static int rm_sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stre
 
             num = avio_rb16(pb);
             *timestamp = avio_rb32(pb);
-            mlti_id = (avio_r8(pb)>>1)-1<<16;
-            mlti_id = FFMAX(mlti_id, 0);
+            mlti_id = avio_r8((pb) >> 1) - 1;
+            mlti_id = FFMAX(mlti_id, 0) << 16;
             *flags = avio_r8(pb); /* flags */
         }
         for(i=0;i<s->nb_streams;i++) {