[FFmpeg-devel] [PATCH v2] mpegencts: Fix overflow in cbr mode period calculations

Michael Niedermayer michaelni at gmx.at
Thu Dec 3 17:53:32 CET 2015

On Sat, Nov 28, 2015 at 08:27:39AM +0200, Timo Teräs wrote:
> ts->mux_rate is int (signed 32-bit) type. The period calculations
> will start to overflow when mux_rate > 5mbps. This fixes overflows
> by converting first to 64-bit type.
> Fixes #5044.
> Signed-off-by: Timo Teräs <timo.teras at iki.fi>
> ---
> Seems av_rescale() was a bit overkill, and specifying the rounding
> mode made the code uglier.. So I just added an explicit cast now.



Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151203/e883de71/attachment.sig>

More information about the ffmpeg-devel mailing list