mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-11 17:55:21 +00:00
avformat/mov: do not set sign bit for chunk_offsets
Fixes: signed integer overflow: 2314885530818453536 - -7412889664301817824 cannot be represented in type 'long'
Fixes: 64296/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6304027146846208
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cfc0a68d4d
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
3044269ae8
commit
bb9390148c
@ -2038,8 +2038,13 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
for (i = 0; i < entries && !pb->eof_reached; i++)
|
for (i = 0; i < entries && !pb->eof_reached; i++)
|
||||||
sc->chunk_offsets[i] = avio_rb32(pb);
|
sc->chunk_offsets[i] = avio_rb32(pb);
|
||||||
else if (atom.type == MKTAG('c','o','6','4'))
|
else if (atom.type == MKTAG('c','o','6','4'))
|
||||||
for (i = 0; i < entries && !pb->eof_reached; i++)
|
for (i = 0; i < entries && !pb->eof_reached; i++) {
|
||||||
sc->chunk_offsets[i] = avio_rb64(pb);
|
sc->chunk_offsets[i] = avio_rb64(pb);
|
||||||
|
if (sc->chunk_offsets[i] < 0) {
|
||||||
|
av_log(c->fc, AV_LOG_WARNING, "Impossible chunk_offset\n");
|
||||||
|
sc->chunk_offsets[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user