[FFmpeg-cvslog] ffmdec: change type of state and id to unsigned

Andreas Cadhalpun git at videolan.org
Sat Jan 2 20:04:35 CET 2016


ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Sat Jan  2 16:27:43 2016 +0100| [2e752c7de9df236ee4e3f36ae6c0b0308c7bc308] | committer: Andreas Cadhalpun

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'

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e752c7de9df236ee4e3f36ae6c0b0308c7bc308
---

 libavformat/ffmdec.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 9fe4155..7f31d14 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -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;



More information about the ffmpeg-cvslog mailing list