On Mon, Oct 18, 2021 at 02:24:08PM +0100, Derek Buitenhuis wrote: > Hi, > > Sorry for the slow reply. > > On 10/12/2021 8:18 PM, Michael Niedermayer wrote: > > 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 > > It's unclear to me from reading the code of av_rescale what happens if > the return value is not representative as an int64_t, for example: > > av_rescale(INT64_MAX/2, INT64_MAX/2, 1); > > I don't think we can even check this usng only av_rescale without > explicit checks before calling it?
av_rescale() should return INT64_MIN on overflows thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The worst form of inequality is to try to make unequal things equal. -- 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".