From c46a8ccbb6fb8e70fd95a7fff57445968a03b9a8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 1 Apr 2020 13:24:01 +0000 Subject: [PATCH] Fix incorrect calculation of extension block number (EBN); previously an incorrect 0 would be used if the line length was exactly 112. --- src/stl_binary_writer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; -- 2.30.2