On Fri, Jun 01, 2012 at 07:55:33PM -0700, Luca Barbato wrote:
> 
> --- a/libavformat/flvdec.c
> +++ b/libavformat/flvdec.c
> @@ -453,6 +467,66 @@ static void clear_index_entries(AVFormatContext *s, 
> int64_t pos)
>  
> +    if (type == AMF_DATA_TYPE_MIXEDARRAY)
> +        avio_seek(pb, 4, SEEK_CUR);
> +    else if (type != AMF_DATA_TYPE_OBJECT)
> +        goto out;
> +
> +    amf_get_string(pb, buf, sizeof(buf));
> +    if (strcmp(buf, "type") || avio_r8(pb) != AMF_DATA_TYPE_STRING)
> +        goto out;
> +
> +    amf_get_string(pb, buf, sizeof(buf));
> +    //FIXME parse it as codec_id
> +    amf_get_string(pb, buf, sizeof(buf));
> +    if (strcmp(buf, "text") || avio_r8(pb) != AMF_DATA_TYPE_STRING)
> +        goto out;
> +
> +    length = avio_rb16(pb);
> +    ret = av_get_packet(s->pb, pkt, length);
> +    if (ret < 0) {
> +        ret = AVERROR(EIO);
> +        goto out;
> +    }
> +
> +    if (i == s->nb_streams) {
> +        st = create_stream(s, 2, AVMEDIA_TYPE_DATA);
> +        if (!st)
> +            goto out;
> +        st->codec->codec_id = CODEC_ID_TEXT;
> +    }
> +
> +out:
> +    return ret;
> +}

That's a rather silly goto; IMO you could just return directly.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to