jpeg_resync_to_restart() is the default resync procedure that a data source manager can invoke when the decompressor fails to find a restart (RSTn) marker where one is expected. The function shall find a suitable point for resuming decompression and position the input stream to the next data segment. The desired restart marker number (0..7) is passed as argument "desired".
jpeg_resync_to_restart() shall return FALSE if decompression is suspended. Otherwise, jpeg_start_output() shall return TRUE.