[FFmpeg-devel] [PATCH] avformat/movenc: suppress -Wstrict-overflow warnings

Michael Niedermayer michaelni at gmx.at
Sun Sep 27 01:11:09 CEST 2015


On Fri, Sep 18, 2015 at 05:15:50PM -0400, Ganesh Ajjanagadde wrote:
> This patch results in identical behavior of movenc, and suppresses -Wstrict-overflow
> warnings observed in GCC 5.2.
> I have manually checked that all usages are safe, and overflow possibility does
> not exist with this expression rewrite.
> 
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  libavformat/movenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index af03d1e..6e4a1a6 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -854,7 +854,7 @@ static int get_cluster_duration(MOVTrack *track, int cluster_idx)
>  {
>      int64_t next_dts;
>  
> -    if (cluster_idx >= track->entry)
> +    if (cluster_idx - track->entry >= 0)

i do not understand what this fixes or why
also plese quote the actual warnings which are fixed in the commit
message

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- 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/20150927/63743494/attachment.sig>


More information about the ffmpeg-devel mailing list