static int gif_video_probe(AVProbeData * pd)

{

    const uint8_t *p, *p_end;

    int bits_per_pixel, has_global_palette, ext_code, ext_len;

    int gce_flags, gce_disposal;



    if (pd->buf_size < 24 ||

        memcmp(pd->buf, gif89a_sig, 6) != 0)

        return 0;

    p_end = pd->buf + pd->buf_size;

    p = pd->buf + 6;

    bits_per_pixel = (p[4] & 0x07) + 1;

    has_global_palette = (p[4] & 0x80);

    p += 7;

    if (has_global_palette)

        p += (1 << bits_per_pixel) * 3;

    for(;;) {

        if (p >= p_end)

            return 0;

        if (*p != '!')

            break;

        p++;

        if (p >= p_end)

            return 0;

        ext_code = *p++;

        if (p >= p_end)

            return 0;

        ext_len = *p++;

        if (ext_code == 0xf9) {

            if (p >= p_end)

                return 0;

            /* if GCE extension found with gce_disposal != 0: it is

               likely to be an animation */

            gce_flags = *p++;

            gce_disposal = (gce_flags >> 2) & 0x7;

            if (gce_disposal != 0)

                return AVPROBE_SCORE_MAX;

            else

                return 0;

        }

        for(;;) {

            if (ext_len == 0)

                break;

            p += ext_len;

            if (p >= p_end)

                return 0;

            ext_len = *p++;

        }

    }

    return 0;

}

static int gif_video_probe(AVProbeData * pd)

{

    const uint8_t *p, *p_end;

    int bits_per_pixel, has_global_palette, ext_code, ext_len;

    int gce_flags, gce_disposal;



    if (pd->buf_size < 24 ||

        memcmp(pd->buf, gif89a_sig, 6) != 0)

        return 0;

    p_end = pd->buf + pd->buf_size;

    p = pd->buf + 6;

    bits_per_pixel = (p[4] & 0x07) + 1;

    has_global_palette = (p[4] & 0x80);

    p += 7;

    if (has_global_palette)

        p += (1 << bits_per_pixel) * 3;

    for(;;) {

        if (p >= p_end)

            return 0;

        if (*p != '!')

            break;

        p++;

        if (p >= p_end)

            return 0;

        ext_code = *p++;

        if (p >= p_end)

            return 0;

        ext_len = *p++;

        if (ext_code == 0xf9) {

            if (p >= p_end)

                return 0;

            



            gce_flags = *p++;

            gce_disposal = (gce_flags >> 2) & 0x7;

            if (gce_disposal != 0)

                return AVPROBE_SCORE_MAX;

            else

                return 0;

        }

        for(;;) {

            if (ext_len == 0)

                break;

            p += ext_len;

            if (p >= p_end)

                return 0;

            ext_len = *p++;

        }

    }

    return 0;

}

static int gif_video_probe(AVProbeData * pd)     const uint8_t *p, *p_end;     int bits_per_pixel, has_global_palette, ext_code, ext_len;     int gce_flags, gce_disposal;     if (pd->buf_size < 24 ||         memcmp(pd->buf, gif89a_sig, 6) != 0)         return 0;     p_end = pd->buf + pd->buf_size;     p = pd->buf + 6;     bits_per_pixel = (p[4] & 0x07) + 1;     has_global_palette = (p[4] & 0x80);     p += 7;     if (has_global_palette)         p += (1 << bits_per_pixel) * 3;     for(;;) {         if (p >= p_end)             return 0;         if (*p != '!')             break;         p++;         if (p >= p_end)             return 0;         ext_code = *p++;         if (p >= p_end)             return 0;         ext_len = *p++;         if (ext_code == 0xf9) {             if (p >= p_end)                 return 0;             gce_flags = *p++;             gce_disposal = (gce_flags >> 2) & 0x7;             if (gce_disposal != 0)                 return AVPROBE_SCORE_MAX;                 return 0;         for(;;) {             if (ext_len == 0)                 break;             p += ext_len;             if (p >= p_end)                 return 0;             ext_len = *p++;     return 0;         return 0;             break;                 break;                 break;                 break;                 break;                 break;     return 0;     return 0;     return 0;             break;     return 0;     return 0;     return 0;
static int FUNC_0(AVProbeData * VAR_0)

{

    const uint8_t *VAR_1, *p_end;

    int VAR_2, VAR_3, VAR_4, VAR_5;

    int VAR_6, VAR_7;



    if (VAR_0->buf_size < 24 ||

        memcmp(VAR_0->buf, gif89a_sig, 6) != 0)

        return 0;

    p_end = VAR_0->buf + VAR_0->buf_size;

    VAR_1 = VAR_0->buf + 6;

    VAR_2 = (VAR_1[4] & 0x07) + 1;

    VAR_3 = (VAR_1[4] & 0x80);

    VAR_1 += 7;

    if (VAR_3)

        VAR_1 += (1 << VAR_2) * 3;

    for(;;) {

        if (VAR_1 >= p_end)

            return 0;

        if (*VAR_1 != '!')

            break;

        VAR_1++;

        if (VAR_1 >= p_end)

            return 0;

        VAR_4 = *VAR_1++;

        if (VAR_1 >= p_end)

            return 0;

        VAR_5 = *VAR_1++;

        if (VAR_4 == 0xf9) {

            if (VAR_1 >= p_end)

                return 0;

            



            VAR_6 = *VAR_1++;

            VAR_7 = (VAR_6 >> 2) & 0x7;

            if (VAR_7 != 0)

                return AVPROBE_SCORE_MAX;

            else

                return 0;

        }

        for(;;) {

            if (VAR_5 == 0)

                break;

            VAR_1 += VAR_5;

            if (VAR_1 >= p_end)

                return 0;

            VAR_5 = *VAR_1++;

        }

    }

    return 0;

}

static int FUNC_0(AVProbeData * VAR_0)
{ const uint8_t *VAR_1, *p_end; int VAR_2, VAR_3, VAR_4, VAR_5; int VAR_6, VAR_7; if (VAR_0->buf_size < 24 ||
memcmp(VAR_0->buf, gif89a_sig, 6) != 0)
return 0; p_end = VAR_0->buf + VAR_0->buf_size; VAR_1 = VAR_0->buf + 6; VAR_2 = (VAR_1[4] & 0x07) + 1; VAR_3 = (VAR_1[4] & 0x80); VAR_1 += 7; if (VAR_3)
VAR_1 += (1 << VAR_2) * 3; for(;;) { if (VAR_1 >= p_end)
return 0; if (*VAR_1 != '!')
break; VAR_1++; if (VAR_1 >= p_end)
return 0; VAR_4 = *VAR_1++; if (VAR_1 >= p_end)
return 0; VAR_5 = *VAR_1++; if (VAR_4 == 0xf9) { if (VAR_1 >= p_end)
return 0; VAR_6 = *VAR_1++; VAR_7 = (VAR_6 >> 2) & 0x7; if (VAR_7 != 0)
return AVPROBE_SCORE_MAX; else
return 0; } for(;;) { if (VAR_5 == 0)
break; VAR_1 += VAR_5; if (VAR_1 >= p_end)
return 0; VAR_5 = *VAR_1++; } } return 0; }