diff --git a/data/nons/invalid.offset_in_cluster.zim b/data/nons/invalid.offset_in_cluster.zim new file mode 100644 index 0000000..b0998bb Binary files /dev/null and b/data/nons/invalid.offset_in_cluster.zim differ diff --git a/data/withns/invalid.offset_in_cluster.zim b/data/withns/invalid.offset_in_cluster.zim new file mode 100644 index 0000000..bc5144f Binary files /dev/null and b/data/withns/invalid.offset_in_cluster.zim differ diff --git a/scripts/create_test_zimfiles b/scripts/create_test_zimfiles index 89ecb3f..59bf041 100755 --- a/scripts/create_test_zimfiles +++ b/scripts/create_test_zimfiles @@ -204,6 +204,16 @@ create_broken_zim_file invalid.outofbounds_first_clusterptr.zim \ "$outofzimfile" \ $((cluster_ptr_pos)) +cluster_ptrs=($($scriptdir/inspectzim --cluster_table small.zim|tail -n +2)) + +# Second cluster is not compressed +cluster_address=$((cluster_ptrs[1])) +echo "cluster address is $cluster_address" + +create_broken_zim_file invalid.offset_in_cluster.zim \ + '\xFF\xFF\xFF\xFF' \ + $((cluster_address+5)) + dirent_ptrs=($($scriptdir/inspectzim --dirent_ptr_table small.zim|tail -n +2)) dirent1_address=$(encode_uint64 $((dirent_ptrs[0])))