} else { while (buf_ptr < buf_end) { v = *buf_ptr++; if (v == 0xff) { state = 1; goto found; } } val = -1;
static int find_marker(UINT8 **pbuf_ptr, UINT8 *buf_end,                        UINT32 *header_state){    UINT8 *buf_ptr;    unsigned int state, v;    int val;    state = *header_state;    buf_ptr = *pbuf_ptr;retry:    if (state) {        /* get marker */    found:        if (buf_ptr < buf_end) {            val = *buf_ptr++;            state = 0;            if ((val >= RST0) && (val <= RST7))                goto retry;        } else {            val = -1;        }    } else {        while (buf_ptr < buf_end) {            v = *buf_ptr++;            if (v == 0xff) {                state = 1;                goto found;            }        }        val = -1;    }    *pbuf_ptr = buf_ptr;    *header_state = state;    return val;}