[FFmpeg-devel] [PATCH] rmdec: avoid leaving st unitialized
Kostya
kostya.shishkov
Sun Jun 6 17:41:48 CEST 2010
On Sun, Jun 06, 2010 at 12:57:48PM +0200, Reimar D?ffinger wrote:
> Hello,
> this fixes a warning with my gcc version, and I think it even fixes a bug:
> Index: rmdec.c
> ===================================================================
> --- rmdec.c (revision 23501)
> +++ rmdec.c (working copy)
> @@ -843,7 +844,7 @@
> pos = url_ftell(s->pb);
> } else {
> len=sync(s, ×tamp, &flags, &i, &pos);
> - if (len > 0)
> + if (len >= 0)
> st = s->streams[i];
> }
>
>
> The next line below this reads:
> if(len<0 || url_feof(s->pb))
> return AVERROR(EIO);
> so >= 0 fits with this condition, and other places treat a 0 value
> from "sync" as ok.
Maybe OK but I'll leave it to Ronald to decide.
More information about the ffmpeg-devel
mailing list