Browse code

pdf: fix for locate DecodeParms for filters

Kevin Lin authored on 2016/04/14 07:29:55
Showing 1 changed files
... ...
@@ -935,7 +935,13 @@ int pdf_extract_obj(struct pdf_struct *pdf, struct pdf_obj *obj, uint32_t flags)
935 935
                 if (pstr) {
936 936
                     unsigned int objsz = obj_size(pdf, obj, 1);
937 937
 
938
-                    /* shift pstr to "<<" for pdf_parse_dict */
938
+                    /* shift pstr left to "<<" for pdf_parse_dict */
939
+                    while ((*pstr == '<') && (pstr > start)) {
940
+                        pstr--;
941
+                        len++;
942
+                    }
943
+
944
+                    /* shift pstr right to "<<" for pdf_parse_dict */
939 945
                     while ((*pstr != '<') && (len > 0)) {
940 946
                         pstr++;
941 947
                         len--;