On Tue, Oct 12, 2021 at 04:17:31PM +0100, Derek Buitenhuis wrote: > On 10/12/2021 3:43 PM, Michael Niedermayer wrote: > > this should be using av_rescale() i think > > That seems unrelated to this patch - but I can send a second patch > that does that, if you want. > > Is your intent something like this; > > if (sc->data_size > INT64_MAX / 8) { > av_log(s, AV_LOG_WARNING, "Overflow during bit rate calculation > %"PRId64" * 8 > INT64_MAX\n", > sc->data_size); > if (s->error_recognition & AV_EF_EXPLODE) > return AVERROR_INVALIDDATA; > } else > st->codecpar->bit_rate = av_rescale(sc->data_size * 8, c->time_scale, > st->duration);
i was thinking of something like st->codecpar->bit_rate = av_rescale(sc->data_size, c->time_scale * 8LL, st->duration); because i thought that would fix the overflow but i didnt look beyond the code in this patch this may still require some check so the value fits in bit_rate, i didnt investigate that thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".