diff options
Diffstat (limited to 'apps/recorder/jpeg_load.c')
-rw-r--r-- | apps/recorder/jpeg_load.c | 15 |
1 files changed, 8 insertions, 7 deletions
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 | ||