Skip to content

Commit

Permalink
Fix error in WinHTTP read
Browse files Browse the repository at this point in the history
  • Loading branch information
plzombie committed Dec 27, 2022
1 parent 711910a commit 7400f5d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fastimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static void fastimageReadJpeg(const fastimage_reader_t *reader, unsigned char *s

jpg_segment_size -= 2;

if(jpg_frame == 0xC0FF || jpg_frame == 0xC1FF || jpg_frame == 0xC2FF || jpg_frame == 0xDBC0) {
if(jpg_frame == 0xC0FF || jpg_frame == 0xC1FF || jpg_frame == 0xC2FF) {
break;
}

Expand All @@ -336,7 +336,7 @@ static void fastimageReadJpeg(const fastimage_reader_t *reader, unsigned char *s
jpg_curr_offt += 2;
}

if(jpg_frame == 0xC0FF || jpg_frame == 0xC1FF || jpg_frame == 0xC2FF || jpg_frame == 0xDBC0) {
if(jpg_frame == 0xC0FF || jpg_frame == 0xC1FF || jpg_frame == 0xC2FF) {
// Found segment with header
unsigned char jpg_bytes[6];

Expand Down Expand Up @@ -775,7 +775,7 @@ typedef struct {
int64_t offset;
} fastimage_http_context_t;

static size_t FASTIMAGE_APIENTRY fastimageHttpRead(void *context, size_t size, void* buf)
static size_t FASTIMAGE_APIENTRY fastimageHttpRead(void *context, size_t size, void *buf)
{
fastimage_http_context_t* httpc;

Expand Down Expand Up @@ -806,6 +806,7 @@ static size_t FASTIMAGE_APIENTRY fastimageHttpRead(void *context, size_t size, v

//printf("downloaded %u\n", data_downloaded);

(char *)buf += data_downloaded;
httpc->offset += data_downloaded;
total_downloaded += data_downloaded;
}
Expand Down

0 comments on commit 7400f5d

Please sign in to comment.