summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/recorder/bmp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c
index e4eb588eb3..a6d6dd71b1 100644
--- a/apps/recorder/bmp.c
+++ b/apps/recorder/bmp.c
@@ -512,7 +512,7 @@ int read_bmp_fd(int fd,
512 int padded_width; 512 int padded_width;
513 int read_width; 513 int read_width;
514 int depth, numcolors, compression, totalsize; 514 int depth, numcolors, compression, totalsize;
515 int ret; 515 int ret, hdr_size;
516 bool return_size = format & FORMAT_RETURN_SIZE; 516 bool return_size = format & FORMAT_RETURN_SIZE;
517 bool read_alpha = format & FORMAT_TRANSPARENT; 517 bool read_alpha = format & FORMAT_TRANSPARENT;
518 enum color_order order = BGRA; 518 enum color_order order = BGRA;
@@ -675,13 +675,15 @@ int read_bmp_fd(int fd,
675 return -6; 675 return -6;
676 } 676 }
677 677
678 hdr_size = letoh32(bmph.struct_size);
678 compression = letoh32(bmph.compression); 679 compression = letoh32(bmph.compression);
679 if (depth <= 8) { 680 if (depth <= 8) {
680 numcolors = letoh32(bmph.clr_used); 681 numcolors = letoh32(bmph.clr_used);
681 if (numcolors == 0) 682 if (numcolors == 0)
682 numcolors = BIT_N(depth); 683 numcolors = BIT_N(depth);
684 /* forward to the color table */
685 lseek(fd, 14+hdr_size, SEEK_SET);
683 } else { 686 } else {
684 int hdr_size = letoh32(bmph.struct_size);
685 numcolors = 0; 687 numcolors = 0;
686 if (compression == 3) { 688 if (compression == 3) {
687 if (hdr_size >= 56) 689 if (hdr_size >= 56)