if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe)) {
if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe) && buf_ptr < buf_end) {
static int find_marker(uint8_t **pbuf_ptr, uint8_t *buf_end){    uint8_t *buf_ptr;    unsigned int v, v2;    int val;#ifdef DEBUG    int skipped=0;#endif    buf_ptr = *pbuf_ptr;    while (buf_ptr < buf_end) {        v = *buf_ptr++;	v2 = *buf_ptr;        if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe)) {	    val = *buf_ptr++;	    goto found;        }#ifdef DEBUG	skipped++;#endif    }    val = -1;found:#ifdef DEBUG    dprintf("find_marker skipped %d bytes\n", skipped);#endif    *pbuf_ptr = buf_ptr;    return val;}