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?

- Derek
_______________________________________________
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".

Reply via email to