Commit 8766361f authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

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: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent 2004d8d3
......@@ -437,6 +437,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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment