static int get_riff(AVFormatContext *s, AVIOContext *pb)

{

    AVIContext *avi = s->priv_data;

    char header[8];

    int i;



    /* check RIFF header */

    avio_read(pb, header, 4);

    avi->riff_end  = avio_rl32(pb); /* RIFF chunk size */

    avi->riff_end += avio_tell(pb); /* RIFF chunk end */

    avio_read(pb, header + 4, 4);



    for (i = 0; avi_headers[i][0]; i++)

        if (!memcmp(header, avi_headers[i], 8))

            break;

    if (!avi_headers[i][0])

        return AVERROR_INVALIDDATA;



    if (header[7] == 0x19)

        av_log(s, AV_LOG_INFO,

               "This file has been generated by a totally broken muxer.\n");



    return 0;

}

static int get_riff(AVFormatContext *s, AVIOContext *pb)

{

    AVIContext *avi = s->priv_data;

    char header[8];

    int i;



    

    avio_read(pb, header, 4);

    avi->riff_end  = avio_rl32(pb); 

    avi->riff_end += avio_tell(pb); 

    avio_read(pb, header + 4, 4);



    for (i = 0; avi_headers[i][0]; i++)

        if (!memcmp(header, avi_headers[i], 8))

            break;

    if (!avi_headers[i][0])

        return AVERROR_INVALIDDATA;



    if (header[7] == 0x19)

        av_log(s, AV_LOG_INFO,

               "This file has been generated by a totally broken muxer.\n");



    return 0;

}

    char header[8];
static int FUNC_0(AVFormatContext *VAR_0, AVIOContext *VAR_1)

{

    AVIContext *avi = VAR_0->priv_data;

    char VAR_2[8];

    int VAR_3;



    

    avio_read(VAR_1, VAR_2, 4);

    avi->riff_end  = avio_rl32(VAR_1); 

    avi->riff_end += avio_tell(VAR_1); 

    avio_read(VAR_1, VAR_2 + 4, 4);



    for (VAR_3 = 0; avi_headers[VAR_3][0]; VAR_3++)

        if (!memcmp(VAR_2, avi_headers[VAR_3], 8))

            break;

    if (!avi_headers[VAR_3][0])

        return AVERROR_INVALIDDATA;



    if (VAR_2[7] == 0x19)

        av_log(VAR_0, AV_LOG_INFO,

               "This file has been generated by a totally broken muxer.\n");



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVIOContext *VAR_1)
{ AVIContext *avi = VAR_0->priv_data; char VAR_2[8]; int VAR_3; avio_read(VAR_1, VAR_2, 4); avi->riff_end  = avio_rl32(VAR_1); avi->riff_end += avio_tell(VAR_1); avio_read(VAR_1, VAR_2 + 4, 4); for (VAR_3 = 0; avi_headers[VAR_3][0]; VAR_3++) if (!memcmp(VAR_2, avi_headers[VAR_3], 8))
break; if (!avi_headers[VAR_3][0])
return AVERROR_INVALIDDATA; if (VAR_2[7] == 0x19)
av_log(VAR_0, AV_LOG_INFO,
"This file has been generated by a totally broken muxer.\n"); return 0; }