static int probe(AVProbeData *p)

{

    unsigned i, frames, checked = 0;



    if (p->buf_size < 22 || AV_RL16(p->buf) || AV_RL16(p->buf + 2) != 1)

        return 0;

    frames = AV_RL16(p->buf + 4);

    if (!frames)

        return 0;

    for (i = 0; i < frames && i * 16 + 22 <= p->buf_size; i++) {

        unsigned offset;

        if (AV_RL16(p->buf + 10 + i * 16) & ~1)

            return FFMIN(i, AVPROBE_SCORE_MAX / 4);

        if (p->buf[13 + i * 16])

            return FFMIN(i, AVPROBE_SCORE_MAX / 4);

        if (AV_RL32(p->buf + 14 + i * 16) < 40)

            return FFMIN(i, AVPROBE_SCORE_MAX / 4);

        offset = AV_RL32(p->buf + 18 + i * 16);

        if (offset < 22)

            return FFMIN(i, AVPROBE_SCORE_MAX / 4);

        if (offset + 8 > p->buf_size)

            continue;

        if (p->buf[offset] != 40 && AV_RB64(p->buf + offset) != PNGSIG)

            return FFMIN(i, AVPROBE_SCORE_MAX / 4);

        checked++;

    }



    if (checked < frames)

        return AVPROBE_SCORE_MAX / 4 + FFMIN(checked, 1);

    return AVPROBE_SCORE_MAX / 2 + 1;

}

static int probe(AVProbeData *p)

{

    unsigned i, frames, checked = 0;



    if (p->buf_size < 22 || AV_RL16(p->buf) || AV_RL16(p->buf + 2) != 1)

        return 0;

    frames = AV_RL16(p->buf + 4);

    if (!frames)

        return 0;

    for (i = 0; i < frames && i * 16 + 22 <= p->buf_size; i++) {

        unsigned offset;

        if (AV_RL16(p->buf + 10 + i * 16) & ~1)

            return FFMIN(i, AVPROBE_SCORE_MAX / 4);

        if (p->buf[13 + i * 16])

            return FFMIN(i, AVPROBE_SCORE_MAX / 4);

        if (AV_RL32(p->buf + 14 + i * 16) < 40)

            return FFMIN(i, AVPROBE_SCORE_MAX / 4);

        offset = AV_RL32(p->buf + 18 + i * 16);

        if (offset < 22)

            return FFMIN(i, AVPROBE_SCORE_MAX / 4);

        if (offset + 8 > p->buf_size)

            continue;

        if (p->buf[offset] != 40 && AV_RB64(p->buf + offset) != PNGSIG)

            return FFMIN(i, AVPROBE_SCORE_MAX / 4);

        checked++;

    }



    if (checked < frames)

        return AVPROBE_SCORE_MAX / 4 + FFMIN(checked, 1);

    return AVPROBE_SCORE_MAX / 2 + 1;

}

        if (offset + 8 > p->buf_size)
static int FUNC_0(AVProbeData *VAR_0)

{

    unsigned VAR_1, VAR_2, VAR_3 = 0;



    if (VAR_0->buf_size < 22 || AV_RL16(VAR_0->buf) || AV_RL16(VAR_0->buf + 2) != 1)

        return 0;

    VAR_2 = AV_RL16(VAR_0->buf + 4);

    if (!VAR_2)

        return 0;

    for (VAR_1 = 0; VAR_1 < VAR_2 && VAR_1 * 16 + 22 <= VAR_0->buf_size; VAR_1++) {

        unsigned offset;

        if (AV_RL16(VAR_0->buf + 10 + VAR_1 * 16) & ~1)

            return FFMIN(VAR_1, AVPROBE_SCORE_MAX / 4);

        if (VAR_0->buf[13 + VAR_1 * 16])

            return FFMIN(VAR_1, AVPROBE_SCORE_MAX / 4);

        if (AV_RL32(VAR_0->buf + 14 + VAR_1 * 16) < 40)

            return FFMIN(VAR_1, AVPROBE_SCORE_MAX / 4);

        offset = AV_RL32(VAR_0->buf + 18 + VAR_1 * 16);

        if (offset < 22)

            return FFMIN(VAR_1, AVPROBE_SCORE_MAX / 4);

        if (offset + 8 > VAR_0->buf_size)

            continue;

        if (VAR_0->buf[offset] != 40 && AV_RB64(VAR_0->buf + offset) != PNGSIG)

            return FFMIN(VAR_1, AVPROBE_SCORE_MAX / 4);

        VAR_3++;

    }



    if (VAR_3 < VAR_2)

        return AVPROBE_SCORE_MAX / 4 + FFMIN(VAR_3, 1);

    return AVPROBE_SCORE_MAX / 2 + 1;

}

static int FUNC_0(AVProbeData *VAR_0)
{ unsigned VAR_1, VAR_2, VAR_3 = 0; if (VAR_0->buf_size < 22 || AV_RL16(VAR_0->buf) || AV_RL16(VAR_0->buf + 2) != 1)
return 0; VAR_2 = AV_RL16(VAR_0->buf + 4); if (!VAR_2)
return 0; for (VAR_1 = 0; VAR_1 < VAR_2 && VAR_1 * 16 + 22 <= VAR_0->buf_size; VAR_1++) { unsigned offset; if (AV_RL16(VAR_0->buf + 10 + VAR_1 * 16) & ~1)
return FFMIN(VAR_1, AVPROBE_SCORE_MAX / 4); if (VAR_0->buf[13 + VAR_1 * 16])
return FFMIN(VAR_1, AVPROBE_SCORE_MAX / 4); if (AV_RL32(VAR_0->buf + 14 + VAR_1 * 16) < 40)
return FFMIN(VAR_1, AVPROBE_SCORE_MAX / 4); offset = AV_RL32(VAR_0->buf + 18 + VAR_1 * 16); if (offset < 22)
return FFMIN(VAR_1, AVPROBE_SCORE_MAX / 4); if (offset + 8 > VAR_0->buf_size)
continue; if (VAR_0->buf[offset] != 40 && AV_RB64(VAR_0->buf + offset) != PNGSIG)
return FFMIN(VAR_1, AVPROBE_SCORE_MAX / 4); VAR_3++; } if (VAR_3 < VAR_2)
return AVPROBE_SCORE_MAX / 4 + FFMIN(VAR_3, 1); return AVPROBE_SCORE_MAX / 2 + 1; }