[FFmpeg-devel] [PATCH 0/1] Fix off-by-one in ASS subtitle encoder

2023-01-05 Thread Tim Angus
When writing a subtitle SSA/ASS subtitle file, the AVCodecParameters::extradata buffer is written directly to the output, including the null terminating character of the buffer. This appears to be a simple off by one bug, which is fixed by the subsequent patch. Tim Angus (1): avformat/assenc

[FFmpeg-devel] [PATCH 1/1] avformat/assenc: fix incorrect copy of null terminator

2023-01-05 Thread Tim Angus
Signed-off-by: Tim Angus --- libavformat/assenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/assenc.c b/libavformat/assenc.c index 1600f0a02b..07b6e3a171 100644 --- a/libavformat/assenc.c +++ b/libavformat/assenc.c @@ -69,7 +69,7 @@ static int write_header

Re: [FFmpeg-devel] [PATCH 1/1] avformat/assenc: fix incorrect copy of null terminator

2023-01-05 Thread Tim Angus
On 05/01/2023 21:11, Andreas Rheinhardt wrote: Tim Angus: Signed-off-by: Tim Angus --- libavformat/assenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/assenc.c b/libavformat/assenc.c index 1600f0a02b..07b6e3a171 100644 --- a/libavformat/assenc.c +++ b

Re: [FFmpeg-devel] [PATCH 1/1] avformat/assenc: fix incorrect copy of null terminator

2023-01-05 Thread Tim Angus
On 05/01/2023 22:03, Andreas Rheinhardt wrote: Yes I did; no failures locally, though I see there are failures in this "patchwork" thingy, presumably that is running extra tests? Did you run FATE with samples or without? No idea, I just ran "make fate" as per the submission checklist. __

[FFmpeg-devel] [PATCH 0/1] Handle ASS format subtitle encoding ambiguity

2023-01-18 Thread Tim Angus
e trailing null terminator(s) present. FATE succeeds as there are no mkvs in the suite that have ASS subtitles embedded. Tim Angus (1): avformat/assenc: fix incorrect copy of null terminator libavformat/assenc.c | 6 ++ 1 file changed, 6 insertions

[FFmpeg-devel] [PATCH] avformat/assenc: fix incorrect copy of null terminator

2023-01-18 Thread Tim Angus
avoiding copying it. Signed-off-by: Tim Angus --- libavformat/assenc.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavformat/assenc.c b/libavformat/assenc.c index 1600f0a02b..5e74b84575 100644 --- a/libavformat/assenc.c +++ b/libavformat/assenc.c @@ -69,6 +69,11 @@ static int

Re: [FFmpeg-devel] [PATCH 0/1] Handle ASS format subtitle encoding ambiguity

2023-01-21 Thread Tim Angus
On 18/01/2023 14:31, Tim Angus wrote: Some matroska files embed ASS format subtitles. The header for said subtitles include the header for the subtitle stream in the "codec private data" section. It appears to be optional whether or not the last byte of this data is 0, i.e. a null term

[FFmpeg-devel] [PATCH 1/1] avformat/assenc: avoid incorrect copy of null terminator

2023-01-27 Thread Tim Angus
. Signed-off-by: Tim Angus --- libavformat/assenc.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/libavformat/assenc.c b/libavformat/assenc.c index 1600f0a02b..4c9ea6f982 100644 --- a/libavformat/assenc.c +++ b/libavformat/assenc.c @@ -24,6 +24,7

[FFmpeg-devel] [PATCH 2/2] avformat/assenc: fix strstr calls on non-string

2023-01-31 Thread Tim Angus
(presumably) they encounter a 0 byte somewhere downstream of extradata. I say notionally because often extradata will in fact be null terminated (which causes other problems, see parent commit). Signed-off-by: Tim Angus --- libavformat/assenc.c | 8 1 file changed, 4 insertions(+), 4 deletions

Re: [FFmpeg-devel] [PATCH] avformat/assenc: fix incorrect copy of null terminator

2023-01-31 Thread Tim Angus
On 31/01/2023 12:37, "zhilizhao(赵志立)" wrote: +/* extradata may or may not be null terminated; in the case where + * it is, avoid copying a null into the middle of the buffer */ +while (header_size > 0 && par->extradata[header_size - 1] == '\0') +header_size--;

Re: [FFmpeg-devel] [PATCH 2/2] avformat/assenc: fix strstr calls on non-string

2023-01-31 Thread Tim Angus
On 31/01/2023 11:13, Tim Angus wrote: In the write_header function of the ASS encoder, extradata is searched for a substring using the strstr function. strstr expects a null terminated C string as its first parameter, but extradata is (notionally) not one of these, meaning that the calls to

Re: [FFmpeg-devel] [PATCH 1/1] avformat/assenc: avoid incorrect copy of null terminator

2023-02-08 Thread Tim Angus
On 27/01/2023 17:20, Tim Angus wrote: When writing a subtitle SSA/ASS subtitle file, the AVCodecParameters::extradata buffer is written directly to the output. In the case where the buffer is filled from a matroska source file produced by some older versions of Handbrake, this buffer ends with a