avformat/subtitles: Honour ff_subtitles_read_line() documentation
It claims to always zero-terminate its buffer like snprintf(),
yet it does it not on EOF. Because of this the mcc demuxer
used uninitialized values when reading an empty input file.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 8766361fc1
)
This commit is contained in:
@ -418,6 +418,7 @@ ptrdiff_t ff_subtitles_read_line(FFTextReader *tr, char *buf, size_t size)
|
||||
size_t cur = 0;
|
||||
if (!size)
|
||||
return 0;
|
||||
buf[0] = '\0';
|
||||
while (cur + 1 < size) {
|
||||
unsigned char c = ff_text_r8(tr);
|
||||
if (!c)
|
||||
|
Reference in New Issue
Block a user