[FFmpeg-cvslog] avformat/lrcenc: Avoid reading packet padding

Andreas Rheinhardt git at videolan.org
Sat Jul 23 23:43:48 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Jul 23 18:55:08 2022 +0200| [30c7cff399334b8924c7461a5c128e23d0cc3680] | committer: Andreas Rheinhardt

avformat/lrcenc: Avoid reading packet padding

(Everything would be fine if the packet was properly padded.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=30c7cff399334b8924c7461a5c128e23d0cc3680
---

 libavformat/lrcenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/lrcenc.c b/libavformat/lrcenc.c
index cdf94e6cd2..f7a5a6982d 100644
--- a/libavformat/lrcenc.c
+++ b/libavformat/lrcenc.c
@@ -105,7 +105,7 @@ static int lrc_write_packet(AVFormatContext *s, AVPacket *pkt)
                     size--;
                 next_line++;
             }
-            if(line[0] == '[') {
+            if (size && line[0] == '[') {
                 av_log(s, AV_LOG_WARNING,
                        "Subtitle starts with '[', may cause problems with LRC format.\n");
             }



More information about the ffmpeg-cvslog mailing list