summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/jpeg_common.h1
-rw-r--r--apps/recorder/jpeg_load.c15
2 files changed, 8 insertions, 8 deletions
diff --git a/apps/recorder/jpeg_common.h b/apps/recorder/jpeg_common.h
index 061cfc8e64..c2abce8f49 100644
--- a/apps/recorder/jpeg_common.h
+++ b/apps/recorder/jpeg_common.h
@@ -139,7 +139,6 @@ struct bitstream
139#define HUFFTAB 0x0001 /* with huffman table */ 139#define HUFFTAB 0x0001 /* with huffman table */
140#define QUANTTAB 0x0002 /* with quantization table */ 140#define QUANTTAB 0x0002 /* with quantization table */
141#define APP0_JFIF 0x0004 /* with APP0 segment following JFIF standard */ 141#define APP0_JFIF 0x0004 /* with APP0 segment following JFIF standard */
142#define FILL_FF 0x0008 /* with 0xFF padding bytes at begin/end */
143#define SOF0 0x0010 /* with SOF0-Segment */ 142#define SOF0 0x0010 /* with SOF0-Segment */
144#define DHT 0x0020 /* with Definition of huffman tables */ 143#define DHT 0x0020 /* with Definition of huffman tables */
145#define SOS 0x0040 /* with Start-of-Scan segment */ 144#define SOS 0x0040 /* with Start-of-Scan segment */
diff --git a/apps/recorder/jpeg_load.c b/apps/recorder/jpeg_load.c
index 46b7cc9bc5..e326d1c18a 100644
--- a/apps/recorder/jpeg_load.c
+++ b/apps/recorder/jpeg_load.c
@@ -956,25 +956,25 @@ static int process_markers(struct jpeg* p_jpeg)
956 int marker_size; /* variable length of marker segment */ 956 int marker_size; /* variable length of marker segment */
957 int i, j, n; 957 int i, j, n;
958 int ret = 0; /* returned flags */ 958 int ret = 0; /* returned flags */
959 bool done = false;
959 960
960 while ((c = e_getc(p_jpeg, -1))) 961 while (!done && (c = e_getc(p_jpeg, -1)))
961 { 962 {
962 if (c != 0xFF) /* no marker? */ 963 if (c != 0xFF) /* no marker? */
963 { 964 {
964 JDEBUGF("Non-marker data\n"); 965 JDEBUGF("Non-marker data\n");
965 jpeg_putc(p_jpeg); 966 continue; /* discard */
966 break; /* exit marker processing */
967 } 967 }
968 968
969 c = e_getc(p_jpeg, -1); 969 c = e_getc(p_jpeg, -1);
970 JDEBUGF("marker value %X\n",c); 970 JDEBUGF("marker value %X\n",c);
971 switch (c) 971 switch (c)
972 { 972 {
973 case 0xFF: /* Fill byte */ 973 case 0xFF: /* Previous FF was fill byte */
974 ret |= FILL_FF; 974 jpeg_putc(p_jpeg); /* This FF could be start of a marker */
975 case 0x00: /* Zero stuffed byte - entropy data */
976 jpeg_putc(p_jpeg);
977 continue; 975 continue;
976 case 0x00: /* Zero stuffed byte */
977 break; /* discard */
978 978
979 case 0xC0: /* SOF Huff - Baseline DCT */ 979 case 0xC0: /* SOF Huff - Baseline DCT */
980 { 980 {
@@ -1132,6 +1132,7 @@ static int process_markers(struct jpeg* p_jpeg)
1132 } 1132 }
1133 /* skip spectral information */ 1133 /* skip spectral information */
1134 e_skip_bytes(p_jpeg, marker_size); 1134 e_skip_bytes(p_jpeg, marker_size);
1135 done = true;
1135 } 1136 }
1136 break; 1137 break;
1137 1138