From: Carl Hetherington Date: Wed, 1 Apr 2020 13:24:01 +0000 (+0000) Subject: Fix incorrect calculation of extension block number (EBN); previously X-Git-Tag: v1.6.0~92 X-Git-Url: https://main.carlh.net/gitweb/?p=libsub.git;a=commitdiff_plain;h=c46a8ccbb6fb8e70fd95a7fff57445968a03b9a8 Fix incorrect calculation of extension block number (EBN); previously an incorrect 0 would be used if the line length was exactly 112. --- diff --git a/src/stl_binary_writer.cc b/src/stl_binary_writer.cc index 456bbe1..adb9e11 100644 --- a/src/stl_binary_writer.cc +++ b/src/stl_binary_writer.cc @@ -272,7 +272,7 @@ make_tti_blocks (list const& subtitles, STLBinaryTables const& tables, offset += this_time; /* Extension block number. Count up from 0 but use 0xff for the last one */ - put_int_as_int (buffer + 3, this_time < block_size ? 0xff : block_number, 1); + put_int_as_int (buffer + 3, offset == text.length() ? 0xff : block_number, 1); ++block_number; char* finished = new char[tti_size];