From: robertlipe Date: Sun, 9 Jun 2013 23:16:41 +0000 (+0000) Subject: garmin_gpi: Seek to image offset in case there's additional headers in the X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~567 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=664f391c9e5a4480122f602ab1b81f1fa56bf850;p=gpsbabel.git garmin_gpi: Seek to image offset in case there's additional headers in the bmp, such as those inserted by gimp, etc. Fix warning when compiling with debug. --- diff --git a/gpsbabel/garmin_gpi.cc b/gpsbabel/garmin_gpi.cc index 11a6cd37b..c2304236f 100644 --- a/gpsbabel/garmin_gpi.cc +++ b/gpsbabel/garmin_gpi.cc @@ -1368,6 +1368,8 @@ load_bitmap_from_file(const char* fname, unsigned char** data, int* data_sz) ptr = (unsigned char*)dest_h; ptr += (sizeof(*dest_h) + (dest_line_sz * (src_h.height - 1))); + gbfseek(f, src_h.image_offset, SEEK_SET); + if (src_h.bpp == 24) { /* 24 bpp seems to be not supported, convert to 32 bpp */ for (i = 0; i < src_h.height; i++) {