Added several checks to ensure that the values read from the headers are consistent Reviewed-by: jrose
Fixes a core dump when fed with a faulty pack file and related malicious take over Reviewed-by: jrose