Commit Diff


commit - 486bf01f6cca4fb29f045a2fabf3bb5499b54225
commit + 867feca8227fc51e897039267b0188160b733e02
blob - ec720ca7c17d42c5ede8a5370888ba55ce9ea0da
blob + c0fd252e51df618c2c1812d4efbeef50918c5d57
--- pdf.c
+++ pdf.c
@@ -889,7 +889,7 @@ init_runlengthdecode_parser(struct Env *aux)
 void
 init_dct_parser(struct Env *aux)
 {
-	H_RULE(jpgmagic, h_ch('\xFF'));
+	H_RULE(jpgmagic, h_ch('\xFF'));			//XXX technically part of the marker segment
 	H_RULE(app0_marker, h_ch('\xE0'));
 	H_RULE(app0_length, h_int16());
 
@@ -932,6 +932,7 @@ init_dct_parser(struct Env *aux)
 
 
 	H_RULE(soi_marker, h_ch('\xD8'));
+	H_RULE(soi, SEQ(soi_marker));
 
 	/* start of scan marker segment */
 	H_RULE(sos_marker, h_ch('\xDA'));
@@ -956,10 +957,14 @@ init_dct_parser(struct Env *aux)
 	H_RULE(sos, SEQ(sos_marker, sos_component_lv, sos_startspectral, sos_endspectral, sos_approxbitpos));
 
 	// XXX rest of the markers
+	H_RULE(eoi_marker, h_ch('\xD9'));
+	H_RULE(eoi, SEQ(eoi_marker));
 
 	// XXX for now this is to prevent unused variable errors when compiling
 	//H_ARULE(dct, SEQ(jpgmagic, app0, sos));
-	H_RULE(dct, SEQ(jpgmagic, app0, sos, soi_marker, sof0, app1));
+	//H_RULE(jpg_frame);
+	//H_RULE(jpg_scan);
+	H_RULE(dct, SEQ(soi, eoi);
 
 	p_dct = dct;
 }