aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-23 21:42:23 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-02-20 14:21:24 +0100
commit73bc98119c35c30eb4f0c52193c8e6c9947a024e (patch)
treef3ace402ebd58938cf9384d662bcb824b1837559
parent4e08ecb7a4b8bff71b2c4af4e8145defae526285 (diff)
downloadffmpeg-73bc98119c35c30eb4f0c52193c8e6c9947a024e.tar.gz
avformat/flvdec: Treat high ts byte as unsigned
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> (cherry picked from commit f514113cfa9fc44d80086bb2a2b783e8026dc3a9) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/flvdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index cd913d32d8..334a5f4a7c 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -1179,7 +1179,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) {