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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jan 22 09:13:23 CET 2012



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?!


More information about the ffmpeg-devel mailing list