]> git.sesse.net Git - ffmpeg/commitdiff
ffmdec: change type of state and id to unsigned
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sat, 2 Jan 2016 15:27:43 +0000 (16:27 +0100)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sat, 2 Jan 2016 19:03:57 +0000 (20:03 +0100)
This fixes ubsan runtime error: left shift by 8 places cannot be
represented in type 'int'

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
libavformat/ffmdec.c

index 9fe41556f154207019329e0bbce9f9220e158e6d..7f31d14445424a2dd842b5d230a25c11a165ad6d 100644 (file)
@@ -68,7 +68,7 @@ static int ffm_is_avail_data(AVFormatContext *s, int size)
         return AVERROR_INVALIDDATA;
 }
 
-static int ffm_resync(AVFormatContext *s, int state)
+static int ffm_resync(AVFormatContext *s, uint32_t state)
 {
     av_log(s, AV_LOG_ERROR, "resyncing\n");
     while (state != PACKET_ID) {
@@ -87,7 +87,8 @@ static int ffm_read_data(AVFormatContext *s,
 {
     FFMContext *ffm = s->priv_data;
     AVIOContext *pb = s->pb;
-    int len, fill_size, size1, frame_offset, id;
+    int len, fill_size, size1, frame_offset;
+    uint32_t id;
     int64_t last_pos = -1;
 
     size1 = size;