libavformat/flvdec.c:626: error: Uninitialized Value
  The value read from is_audio was never initialized.

libavformat/flvdec.c:626:9: 
624.     }
625. 
626.     if (is_audio || ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY))
             ^
627.         pkt->flags |= AV_PKT_FLAG_KEY;
628. 

static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
{
    FLVContext *flv = s->priv_data;
    int ret, i, type, size, flags, is_audio;
    int64_t next, pos;
    int64_t dts, pts = AV_NOPTS_VALUE;
    int sample_rate, channels;
    AVStream *st = NULL;
 for(;;avio_skip(s->pb, 4)){
    pos = avio_tell(s->pb);
    type = avio_r8(s->pb);
    size = avio_rb24(s->pb);
    dts = avio_rb24(s->pb);
    dts |= avio_r8(s->pb) << 24;
    av_dlog(s, "type:%d, size:%d, dts:%"PRId64"\n", type, size, dts);
    if (s->pb->eof_reached)
        return AVERROR_EOF;
    avio_skip(s->pb, 3);
    flags = 0;
    if(size == 0)
        continue;
    next= size + avio_tell(s->pb);
    if (type == FLV_TAG_TYPE_AUDIO) {
        is_audio=1;
        flags = avio_r8(s->pb);
        size--;
    } else if (type == FLV_TAG_TYPE_VIDEO) {
        is_audio=0;
        flags = avio_r8(s->pb);
        size--;
        if ((flags & 0xf0) == 0x50)
            goto skip;
    } else {
        if (type == FLV_TAG_TYPE_META && size > 13+1+4)
            flv_read_metabody(s, next);
        else
            av_log(s, AV_LOG_DEBUG, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags);
    skip:
        avio_seek(s->pb, next, SEEK_SET);
        continue;
    }
    if (!size)
        continue;
    for(i=0;i<s->nb_streams;i++) {
        st = s->streams[i];
        if (st->id == is_audio)
            break;
    }
    if(i == s->nb_streams){
        av_log(s, AV_LOG_ERROR, "invalid stream\n");
        st= create_stream(s, is_audio);
        s->ctx_flags &= ~AVFMTCTX_NOHEADER;
    }
    av_dlog(s, "%d %X %d \n", is_audio, flags, st->discard);
    if(  (st->discard >= AVDISCARD_NONKEY && !((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY ||         is_audio))
       ||(st->discard >= AVDISCARD_BIDIR  &&  ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_DISP_INTER && !is_audio))
       || st->discard >= AVDISCARD_ALL
       ){
        avio_seek(s->pb, next, SEEK_SET);
        continue;
    }
    if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)
        av_add_index_entry(st, pos, dts, size, 0, AVINDEX_KEYFRAME);
    break;
 }
    if(s->pb->seekable && (!s->duration || s->duration==AV_NOPTS_VALUE)){
        int size;
        const int64_t pos= avio_tell(s->pb);
        const int64_t fsize= avio_size(s->pb);
        avio_seek(s->pb, fsize-4, SEEK_SET);
        size= avio_rb32(s->pb);
        avio_seek(s->pb, fsize-3-size, SEEK_SET);
        if(size == avio_rb24(s->pb) + 11){
            uint32_t ts = avio_rb24(s->pb);
            ts |= avio_r8(s->pb) << 24;
            s->duration = ts * (int64_t)AV_TIME_BASE / 1000;
        }
        avio_seek(s->pb, pos, SEEK_SET);
    }
    if(is_audio){
        int bits_per_coded_sample;
        channels    = (flags & FLV_AUDIO_CHANNEL_MASK) == FLV_STEREO ? 2 : 1;
        sample_rate = (44100 << ((flags & FLV_AUDIO_SAMPLERATE_MASK) >> FLV_AUDIO_SAMPLERATE_OFFSET) >> 3);
        bits_per_coded_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8;
        if(!st->codec->channels || !st->codec->sample_rate || !st->codec->bits_per_coded_sample) {
            st->codec->channels              = channels;
            st->codec->sample_rate           = sample_rate;
            st->codec->bits_per_coded_sample = bits_per_coded_sample;
        }
        if(!st->codec->codec_id){
            flv_set_audio_codec(s, st, st->codec, flags & FLV_AUDIO_CODECID_MASK);
            flv->last_sample_rate = st->codec->sample_rate;
            flv->last_channels    = st->codec->channels;
        } else {
            AVCodecContext ctx;
            ctx.sample_rate = sample_rate;
            flv_set_audio_codec(s, st, &ctx, flags & FLV_AUDIO_CODECID_MASK);
            sample_rate = ctx.sample_rate;
        }
    }else{
        size -= flv_set_video_codec(s, st, flags & FLV_VIDEO_CODECID_MASK);
    }
    if (st->codec->codec_id == CODEC_ID_AAC ||
        st->codec->codec_id == CODEC_ID_H264) {
        int type = avio_r8(s->pb);
        size--;
        if (st->codec->codec_id == CODEC_ID_H264) {
            int32_t cts = (avio_rb24(s->pb)+0xff800000)^0xff800000;
            pts = dts + cts;
            if (cts < 0) {
                flv->wrong_dts = 1;
                av_log(s, AV_LOG_WARNING, "negative cts, previous timestamps might be wrong\n");
            }
            if (flv->wrong_dts)
                dts = AV_NOPTS_VALUE;
        }
        if (type == 0) {
            if (st->codec->extradata) {
                if ((ret = flv_queue_extradata(flv, s->pb, is_audio, size)) < 0)
                    return ret;
                ret = AVERROR(EAGAIN);
                goto leave;
            }
            if ((ret = flv_get_extradata(s, st, size)) < 0)
                return ret;
            if (st->codec->codec_id == CODEC_ID_AAC) {
                MPEG4AudioConfig cfg;
                avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
                                             st->codec->extradata_size * 8, 1);
                st->codec->channels = cfg.channels;
                if (cfg.ext_sample_rate)
                    st->codec->sample_rate = cfg.ext_sample_rate;
                else
                    st->codec->sample_rate = cfg.sample_rate;
                av_dlog(s, "mp4a config channels %d sample rate %d\n",
                        st->codec->channels, st->codec->sample_rate);
            }
            ret = AVERROR(EAGAIN);
            goto leave;
        }
    }
    if (!size) {
        ret = AVERROR(EAGAIN);
        goto leave;
    }
    ret= av_get_packet(s->pb, pkt, size);
    if (ret < 0) {
        return AVERROR(EIO);
    }
    pkt->size = ret;
    pkt->dts = dts;
    pkt->pts = pts == AV_NOPTS_VALUE ? dts : pts;
    pkt->stream_index = st->index;
    if (flv->new_extradata[is_audio]) {
        uint8_t *side = av_packet_new_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
                                                flv->new_extradata_size[is_audio]);
        if (side) {
            memcpy(side, flv->new_extradata[is_audio],
                   flv->new_extradata_size[is_audio]);
            av_freep(&flv->new_extradata[is_audio]);
            flv->new_extradata_size[is_audio] = 0;
        }
    }
    if (is_audio && (sample_rate != flv->last_sample_rate ||
                     channels != flv->last_channels)) {
        flv->last_sample_rate = sample_rate;
        flv->last_channels    = channels;
        ff_add_param_change(pkt, channels, 0, sample_rate, 0, 0);
    }
    if (is_audio || ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY))
        pkt->flags |= AV_PKT_FLAG_KEY;
leave:
    avio_skip(s->pb, 4);
    return ret;
}
['static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)\n{\n    FLVContext *flv = s->priv_data;\n    int ret, i, type, size, flags, is_audio;\n    int64_t next, pos;\n    int64_t dts, pts = AV_NOPTS_VALUE;\n    int sample_rate, channels;\n    AVStream *st = NULL;\n for(;;avio_skip(s->pb, 4)){\n    pos = avio_tell(s->pb);\n    type = avio_r8(s->pb);\n    size = avio_rb24(s->pb);\n    dts = avio_rb24(s->pb);\n    dts |= avio_r8(s->pb) << 24;\n    av_dlog(s, "type:%d, size:%d, dts:%"PRId64"\\n", type, size, dts);\n    if (s->pb->eof_reached)\n        return AVERROR_EOF;\n    avio_skip(s->pb, 3);\n    flags = 0;\n    if(size == 0)\n        continue;\n    next= size + avio_tell(s->pb);\n    if (type == FLV_TAG_TYPE_AUDIO) {\n        is_audio=1;\n        flags = avio_r8(s->pb);\n        size--;\n    } else if (type == FLV_TAG_TYPE_VIDEO) {\n        is_audio=0;\n        flags = avio_r8(s->pb);\n        size--;\n        if ((flags & 0xf0) == 0x50)\n            goto skip;\n    } else {\n        if (type == FLV_TAG_TYPE_META && size > 13+1+4)\n            flv_read_metabody(s, next);\n        else\n            av_log(s, AV_LOG_DEBUG, "skipping flv packet: type %d, size %d, flags %d\\n", type, size, flags);\n    skip:\n        avio_seek(s->pb, next, SEEK_SET);\n        continue;\n    }\n    if (!size)\n        continue;\n    for(i=0;i<s->nb_streams;i++) {\n        st = s->streams[i];\n        if (st->id == is_audio)\n            break;\n    }\n    if(i == s->nb_streams){\n        av_log(s, AV_LOG_ERROR, "invalid stream\\n");\n        st= create_stream(s, is_audio);\n        s->ctx_flags &= ~AVFMTCTX_NOHEADER;\n    }\n    av_dlog(s, "%d %X %d \\n", is_audio, flags, st->discard);\n    if(  (st->discard >= AVDISCARD_NONKEY && !((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY ||         is_audio))\n       ||(st->discard >= AVDISCARD_BIDIR  &&  ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_DISP_INTER && !is_audio))\n       || st->discard >= AVDISCARD_ALL\n       ){\n        avio_seek(s->pb, next, SEEK_SET);\n        continue;\n    }\n    if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)\n        av_add_index_entry(st, pos, dts, size, 0, AVINDEX_KEYFRAME);\n    break;\n }\n    if(s->pb->seekable && (!s->duration || s->duration==AV_NOPTS_VALUE)){\n        int size;\n        const int64_t pos= avio_tell(s->pb);\n        const int64_t fsize= avio_size(s->pb);\n        avio_seek(s->pb, fsize-4, SEEK_SET);\n        size= avio_rb32(s->pb);\n        avio_seek(s->pb, fsize-3-size, SEEK_SET);\n        if(size == avio_rb24(s->pb) + 11){\n            uint32_t ts = avio_rb24(s->pb);\n            ts |= avio_r8(s->pb) << 24;\n            s->duration = ts * (int64_t)AV_TIME_BASE / 1000;\n        }\n        avio_seek(s->pb, pos, SEEK_SET);\n    }\n    if(is_audio){\n        int bits_per_coded_sample;\n        channels    = (flags & FLV_AUDIO_CHANNEL_MASK) == FLV_STEREO ? 2 : 1;\n        sample_rate = (44100 << ((flags & FLV_AUDIO_SAMPLERATE_MASK) >> FLV_AUDIO_SAMPLERATE_OFFSET) >> 3);\n        bits_per_coded_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8;\n        if(!st->codec->channels || !st->codec->sample_rate || !st->codec->bits_per_coded_sample) {\n            st->codec->channels              = channels;\n            st->codec->sample_rate           = sample_rate;\n            st->codec->bits_per_coded_sample = bits_per_coded_sample;\n        }\n        if(!st->codec->codec_id){\n            flv_set_audio_codec(s, st, st->codec, flags & FLV_AUDIO_CODECID_MASK);\n            flv->last_sample_rate = st->codec->sample_rate;\n            flv->last_channels    = st->codec->channels;\n        } else {\n            AVCodecContext ctx;\n            ctx.sample_rate = sample_rate;\n            flv_set_audio_codec(s, st, &ctx, flags & FLV_AUDIO_CODECID_MASK);\n            sample_rate = ctx.sample_rate;\n        }\n    }else{\n        size -= flv_set_video_codec(s, st, flags & FLV_VIDEO_CODECID_MASK);\n    }\n    if (st->codec->codec_id == CODEC_ID_AAC ||\n        st->codec->codec_id == CODEC_ID_H264) {\n        int type = avio_r8(s->pb);\n        size--;\n        if (st->codec->codec_id == CODEC_ID_H264) {\n            int32_t cts = (avio_rb24(s->pb)+0xff800000)^0xff800000;\n            pts = dts + cts;\n            if (cts < 0) {\n                flv->wrong_dts = 1;\n                av_log(s, AV_LOG_WARNING, "negative cts, previous timestamps might be wrong\\n");\n            }\n            if (flv->wrong_dts)\n                dts = AV_NOPTS_VALUE;\n        }\n        if (type == 0) {\n            if (st->codec->extradata) {\n                if ((ret = flv_queue_extradata(flv, s->pb, is_audio, size)) < 0)\n                    return ret;\n                ret = AVERROR(EAGAIN);\n                goto leave;\n            }\n            if ((ret = flv_get_extradata(s, st, size)) < 0)\n                return ret;\n            if (st->codec->codec_id == CODEC_ID_AAC) {\n                MPEG4AudioConfig cfg;\n                avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,\n                                             st->codec->extradata_size * 8, 1);\n                st->codec->channels = cfg.channels;\n                if (cfg.ext_sample_rate)\n                    st->codec->sample_rate = cfg.ext_sample_rate;\n                else\n                    st->codec->sample_rate = cfg.sample_rate;\n                av_dlog(s, "mp4a config channels %d sample rate %d\\n",\n                        st->codec->channels, st->codec->sample_rate);\n            }\n            ret = AVERROR(EAGAIN);\n            goto leave;\n        }\n    }\n    if (!size) {\n        ret = AVERROR(EAGAIN);\n        goto leave;\n    }\n    ret= av_get_packet(s->pb, pkt, size);\n    if (ret < 0) {\n        return AVERROR(EIO);\n    }\n    pkt->size = ret;\n    pkt->dts = dts;\n    pkt->pts = pts == AV_NOPTS_VALUE ? dts : pts;\n    pkt->stream_index = st->index;\n    if (flv->new_extradata[is_audio]) {\n        uint8_t *side = av_packet_new_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,\n                                                flv->new_extradata_size[is_audio]);\n        if (side) {\n            memcpy(side, flv->new_extradata[is_audio],\n                   flv->new_extradata_size[is_audio]);\n            av_freep(&flv->new_extradata[is_audio]);\n            flv->new_extradata_size[is_audio] = 0;\n        }\n    }\n    if (is_audio && (sample_rate != flv->last_sample_rate ||\n                     channels != flv->last_channels)) {\n        flv->last_sample_rate = sample_rate;\n        flv->last_channels    = channels;\n        ff_add_param_change(pkt, channels, 0, sample_rate, 0, 0);\n    }\n    if (is_audio || ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY))\n        pkt->flags |= AV_PKT_FLAG_KEY;\nleave:\n    avio_skip(s->pb, 4);\n    return ret;\n}']