diff mbox series

[FFmpeg-devel,10/20] avformat/sccdec: Avoid zero-terminating unnecessarily

Message ID AM7PR03MB66601EA7C1F8A25AD151FFED8FAB9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 2004d8d36dd5f85ae806ea00f7cd78a2c65d3815
Headers show
Series [FFmpeg-devel,01/20] libpostproc/postprocess_template: Don't reimplement FFSWAP | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 1, 2021, 9:08 p.m. UTC
ff_subtitles_queue_insert() does not require its events to be
zero-terminated as it has a parameter for the length.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/sccdec.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Paul B Mahol Oct. 2, 2021, 3 p.m. UTC | #1
probably fine
diff mbox series

Patch

diff --git a/libavformat/sccdec.c b/libavformat/sccdec.c
index ea9f014cf2..6935ea4c3e 100644
--- a/libavformat/sccdec.c
+++ b/libavformat/sccdec.c
@@ -117,8 +117,6 @@  static int scc_read_header(AVFormatContext *s)
             if (i > 12 && o1 == 0x94 && o2 == 0x20 && saveptr &&
                 (av_strncasecmp(saveptr, "942f", 4) && !av_strncasecmp(saveptr, "942c", 4))) {
 
-                out[i] = 0;
-
                 sub = ff_subtitles_queue_insert(&scc->q, out, i, 0);
                 if (!sub)
                     return AVERROR(ENOMEM);
@@ -136,8 +134,6 @@  static int scc_read_header(AVFormatContext *s)
             out[i+2] = o2;
         }
 
-        out[i] = 0;
-
         sub = ff_subtitles_queue_insert(&scc->q, out, i, 0);
         if (!sub)
             return AVERROR(ENOMEM);