diff mbox series

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

Message ID DB6PR0101MB22149A8D44F07817774B1F458F939@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com
State Accepted
Commit 30c7cff399334b8924c7461a5c128e23d0cc3680
Headers show
Series [FFmpeg-devel] avformat/lrcenc: Avoid reading packet padding | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt July 23, 2022, 4:56 p.m. UTC
(Everything would be fine if the packet was properly padded.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/lrcenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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");
             }