XP_BCOPY (src->pub.next_input_byte, src->backtrack_buffer + src->backtrack_buflen,
nsCRT::memmove(src->backtrack_buffer + src->backtrack_buflen, src->pub.next_input_byte,
fill_input_buffer (j_decompress_ptr jd){	il_source_mgr *src = (il_source_mgr *)jd->src;	enum data_source_state src_state = src->state;    uint32 bytesToSkip, new_backtrack_buflen, new_buflen, roundup_buflen;	unsigned char *new_buffer;	ILTRACE(5,("il:jpeg: fill, state=%d, nib=0x%x, bib=%d", src_state,               src->pub.next_input_byte, src->pub.bytes_in_buffer));	switch (src_state) {	/* Decompressor reached end of backtrack buffer. Return netlib buffer.*/	case dss_consuming_backtrack_buffer:		new_buffer = (unsigned char *)src->netlib_buffer;		new_buflen = src->netlib_buflen;        if ((new_buffer == NULL) || (new_buflen == 0))            goto suspend;        /*         * Clear, so that repeated calls to fill_input_buffer() do not         * deliver the same netlib buffer more than once.         */        src->netlib_buflen = 0;        		/* Discard data if asked by skip_input_data(). */		bytesToSkip = src->bytes_to_skip;		if (bytesToSkip) {			if (bytesToSkip < new_buflen) {				/* All done skipping bytes; Return what's left. */				new_buffer += bytesToSkip;				new_buflen -= bytesToSkip;				src->bytes_to_skip = 0;			} else {				/* Still need to skip some more data in the future */				src->bytes_to_skip -= (size_t)new_buflen;                goto suspend;			}		}		/* Save old backtrack buffer parameters, in case the decompressor		 * backtracks and we're forced to restore its contents.		 */		src->backtrack_num_unread_bytes = src->pub.bytes_in_buffer;		src->pub.next_input_byte = new_buffer;		src->pub.bytes_in_buffer = (size_t)new_buflen;		src->state = dss_consuming_netlib_buffer;		return TRUE;	/* Reached end of netlib buffer. Suspend */	case dss_consuming_netlib_buffer:		if (src->pub.next_input_byte != src->netlib_buffer) {			/* Backtrack data has been permanently consumed. */			src->backtrack_num_unread_bytes = 0;			src->backtrack_buflen = 0;		}		/* Save remainder of netlib buffer in backtrack buffer */		new_backtrack_buflen = src->pub.bytes_in_buffer + src->backtrack_buflen;						/* Make sure backtrack buffer is big enough to hold new data. */		if (src->backtrack_buffer_size < new_backtrack_buflen) {			/* Round up to multiple of 16 bytes. */			roundup_buflen = ((new_backtrack_buflen + 15) >> 4) << 4;			if (src->backtrack_buffer_size) {				src->backtrack_buffer =					(JOCTET *)PR_REALLOC(src->backtrack_buffer, roundup_buflen);			} else {				src->backtrack_buffer = (JOCTET*)PR_MALLOC(roundup_buflen);			}            /* Check for OOM */            if (! src->backtrack_buffer) {                j_common_ptr cinfo = (j_common_ptr)(&src->js->jd);                cinfo->err->msg_code = JERR_OUT_OF_MEMORY;				il_error_exit(cinfo);            }                			src->backtrack_buffer_size = (size_t)roundup_buflen;			/* Check for malformed MARKER segment lengths. */			if (new_backtrack_buflen > MAX_JPEG_MARKER_LENGTH)				il_error_exit((j_common_ptr)(&src->js->jd));		}		/* Copy remainder of netlib buffer into backtrack buffer. */		XP_BCOPY (src->pub.next_input_byte,				  src->backtrack_buffer + src->backtrack_buflen,				  src->pub.bytes_in_buffer);		/* Point to start of data to be rescanned. */		src->pub.next_input_byte = src->backtrack_buffer +			src->backtrack_buflen - src->backtrack_num_unread_bytes;		src->pub.bytes_in_buffer += src->backtrack_num_unread_bytes;		src->backtrack_buflen = (size_t)new_backtrack_buflen;				src->state = dss_consuming_backtrack_buffer;        goto suspend;				default:		PR_ASSERT(0);        return FALSE;	}  suspend:    ILTRACE(5,("         Suspending, bib=%d", src->pub.bytes_in_buffer));    return FALSE;}