diff mbox series

[FFmpeg-devel,1/3] avformat/flvdec: Treat high ts byte as unsigned

Message ID 20201123234204.24194-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/3] avformat/flvdec: Treat high ts byte as unsigned
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Michael Niedermayer Nov. 23, 2020, 11:42 p.m. UTC
Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 27516/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5152854660349952

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/flvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index ad6e7a3ca5..3edb16722b 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -1158,7 +1158,7 @@  retry_duration:
             avio_seek(s->pb, fsize - 3 - size, SEEK_SET);
             if (size == avio_rb24(s->pb) + 11) {
                 uint32_t ts = avio_rb24(s->pb);
-                ts         |= avio_r8(s->pb) << 24;
+                ts         |= (unsigned)avio_r8(s->pb) << 24;
                 if (ts)
                     s->duration = ts * (int64_t)AV_TIME_BASE / 1000;
                 else if (fsize >= 8 && fsize - 8 >= size) {