[FFmpeg-devel] [PATCH] Possible bugfix for matroskadec.c
Aurelien Jacobs
aurel
Fri Aug 10 17:10:04 CEST 2007
On Fri, 10 Aug 2007 10:57:05 +0200
Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Hi!
>
> When compiling matroskadec.c, icc complains about a senseless comparison
> (uint64_t cluster_time and int16_t block_time):
>
> matroskadec.c(2385): warning #186: pointless comparison of unsigned
> integer with zero
> if (cluster_time != (uint64_t)-1 && cluster_time + block_time >= 0)
cluster_time + block_time is not unsigned ! I would consider this is
a bug in icc...
> Attached is a patch that might fix this issue (but I didn't look into
> the actual semantic of the code, so it might be completely wrong).
>
> Please comment, Carl Eugen
>
> Index: libavformat/matroskadec.c
> ===================================================================
> --- libavformat/matroskadec.c (Revision 10049)
> +++ libavformat/matroskadec.c (Arbeitskopie)
> @@ -2382,7 +2382,7 @@
> int real_v = matroska->tracks[track]->flags & MATROSKA_TRACK_REAL_V;
> uint64_t timecode = AV_NOPTS_VALUE;
>
> - if (cluster_time != (uint64_t)-1 && cluster_time + block_time >= 0)
> + if (cluster_time != (uint64_t)-1 && cluster_time > -block_time)
You should keep >= instead of >.
If icc still don't complain with >=, then I'm ok with this change.
Aurel
More information about the ffmpeg-devel
mailing list