Skip to content

Commit

Permalink
Merge pull request #42 from kAworu/master
Browse files Browse the repository at this point in the history
fix mjpeg_decode_rgb32().
  • Loading branch information
dlbeer committed Jan 31, 2018
2 parents eca042a + d283137 commit 307473d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions demo/mjpeg.c
Expand Up @@ -232,15 +232,16 @@ int mjpeg_decode_rgb32(struct mjpeg_decoder *mj,
}
while (mj->dinfo.output_scanline < mj->dinfo.image_height) {
uint8_t *scr = out + pitch * mj->dinfo.output_scanline;
uint8_t *output = rgb;
int i;

jpeg_read_scanlines(&mj->dinfo, &rgb, 1);
jpeg_read_scanlines(&mj->dinfo, &output, 1);
for (i = 0; i < mj->dinfo.image_width; i++) {
scr[0] = rgb[2];
scr[1] = rgb[1];
scr[2] = rgb[0];
scr[0] = output[2];
scr[1] = output[1];
scr[2] = output[0];
scr += 4;
rgb += 3;
output += 3;
}
}
free(rgb);
Expand Down

0 comments on commit 307473d

Please sign in to comment.