avformat/mov: Use 64bit in intermediate for current_dts
Fixes: CID1500304 Unintentional integer overflow Fixes: CID1500318 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 0c977d37aad609f6ed7d148c012da8bc83df8f0b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
9e6950dcb4
commit
488aa52371
@ -3386,12 +3386,12 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
corrected_dts += sample_duration * sample_count;
|
corrected_dts += sample_duration * sample_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
current_dts += sc->stts_data[i].duration * sample_count;
|
current_dts += sc->stts_data[i].duration * (int64_t)sample_count;
|
||||||
|
|
||||||
if (current_dts > corrected_dts) {
|
if (current_dts > corrected_dts) {
|
||||||
int64_t drift = (current_dts - corrected_dts)/FFMAX(sample_count, 1);
|
int64_t drift = (current_dts - corrected_dts)/FFMAX(sample_count, 1);
|
||||||
uint32_t correction = (sc->stts_data[i].duration > drift) ? drift : sc->stts_data[i].duration - 1;
|
uint32_t correction = (sc->stts_data[i].duration > drift) ? drift : sc->stts_data[i].duration - 1;
|
||||||
current_dts -= correction * sample_count;
|
current_dts -= correction * (uint64_t)sample_count;
|
||||||
sc->stts_data[i].duration -= correction;
|
sc->stts_data[i].duration -= correction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user