[FFmpeg-devel] [PATCH 1/2] avidec: fix "avidec.c:362: warning: st may be used uninitialized in this function"

Michael Niedermayer michaelni at gmx.at
Mon Jan 23 18:28:49 CET 2012


On Mon, Jan 23, 2012 at 08:43:11AM +0100, Reimar Döffinger wrote:
> On 23 Jan 2012, at 03:37, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Sun, Jan 22, 2012 at 09:13:23AM +0100, Reimar Döffinger wrote:
> >> 
> >> 
> >> On 20 Jan 2012, at 20:59, Michael Niedermayer <michaelni at gmx.at> wrote:
> >> 
> >>> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> >>> ---
> >>> libavformat/avidec.c |    1 +
> >>> 1 files changed, 1 insertions(+), 0 deletions(-)
> >>> 
> >>> diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> >>> index 76dda0f..1c650dc 100644
> >>> --- a/libavformat/avidec.c
> >>> +++ b/libavformat/avidec.c
> >>> @@ -699,6 +699,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
> >>>            }
> >>>            break;
> >>>        case MKTAG('s', 't', 'r', 'd'):
> >>> +            st = s->streams[stream_index];
> >>>            if (stream_index >= (unsigned)s->nb_streams || st->codec->extradata_size) {
> >> 
> >> Huh? Aren't you using stream_index now before validating it?!
> > 
> > The only use i see is after its validated, but i might be missing
> > something ?
> 
> You first use it to index index into s->streams and after that there is the check that it is not larger than nb_streams, that makes no sense to me.

right, iam silly
locally fixed

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

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120123/23205b94/attachment.asc>


More information about the ffmpeg-devel mailing list