mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-20 06:11:04 +00:00
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>
This commit is contained in:
parent
2004d8d36d
commit
8766361fc1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user