hmmlib2 2.0.12: Clamp ref->offset to text_len
This commit is contained in:
		
							parent
							
								
									c104500020
								
							
						
					
					
						commit
						a6a9653306
					
				| 
						 | 
				
			
			@ -696,6 +696,13 @@ static void _hmml_parse_timestamps(struct _hmml_parser* p)
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for(size_t i = 0; i < ts.reference_count; ++i) {
 | 
			
		||||
            HMML_Reference* ref = ts.references + i;
 | 
			
		||||
            if(ref->offset > text_len) {
 | 
			
		||||
                ref->offset = text_len;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        _hmml_persist_array(p, &p->out.timestamps, &p->out.timestamp_count, ts);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -813,7 +820,7 @@ void hmml_free(HMML_Output* out)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
const struct HMML_Version hmml_version = {
 | 
			
		||||
    2, 0, 11
 | 
			
		||||
    2, 0, 12
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#undef HSTX
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue