Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH] avcodec/ttmlenc: Use string literal macro for default namespacing
Date: Sun, 31 Jul 2022 05:02:00 +0200
Message-ID: <DB6PR0101MB22145B109621A6105512CA978F9B9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com> (raw)

Fixes -Werror=format-security build failures when building with
disabled optimizations and (according to fate.ffmpeg.org also with
several other old GCC versions).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
Will apply this soon to unbreak FATE.

 libavcodec/ttmlenc.c  |  2 +-
 libavcodec/ttmlenc.h  | 10 +++++-----
 libavformat/ttmlenc.c |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/ttmlenc.c b/libavcodec/ttmlenc.c
index 2a0be99028..7a09c8fb5e 100644
--- a/libavcodec/ttmlenc.c
+++ b/libavcodec/ttmlenc.c
@@ -315,7 +315,7 @@ static int ttml_write_header_content(AVCodecContext *avctx)
     }
 
     // write the first string in extradata, attributes in the base "tt" element.
-    av_bprintf(&s->buffer, ttml_default_namespacing);
+    av_bprintf(&s->buffer, TTML_DEFAULT_NAMESPACING);
     // the cell resolution is in character cells, so not exactly 1:1 against
     // a pixel based resolution, but as the tts:extent in the root
     // "tt" element is frowned upon (and disallowed in the EBU-TT profile),
diff --git a/libavcodec/ttmlenc.h b/libavcodec/ttmlenc.h
index 654ca0ee4d..cbed6f63b3 100644
--- a/libavcodec/ttmlenc.h
+++ b/libavcodec/ttmlenc.h
@@ -25,10 +25,10 @@
 #define TTMLENC_EXTRADATA_SIGNATURE "lavc-ttmlenc"
 #define TTMLENC_EXTRADATA_SIGNATURE_SIZE (sizeof(TTMLENC_EXTRADATA_SIGNATURE) - 1)
 
-static const char *const ttml_default_namespacing =
-"  xmlns=\"http://www.w3.org/ns/ttml\"\n"
-"  xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\"\n"
-"  xmlns:tts=\"http://www.w3.org/ns/ttml#styling\"\n"
-"  xmlns:ttp=\"http://www.w3.org/ns/ttml#parameter\"\n";
+#define TTML_DEFAULT_NAMESPACING                        \
+"  xmlns=\"http://www.w3.org/ns/ttml\"\n"               \
+"  xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\"\n"  \
+"  xmlns:tts=\"http://www.w3.org/ns/ttml#styling\"\n"   \
+"  xmlns:ttp=\"http://www.w3.org/ns/ttml#parameter\"\n"
 
 #endif /* AVCODEC_TTMLENC_H */
diff --git a/libavformat/ttmlenc.c b/libavformat/ttmlenc.c
index 896fc81958..fc8069f7b5 100644
--- a/libavformat/ttmlenc.c
+++ b/libavformat/ttmlenc.c
@@ -91,7 +91,7 @@ static int ttml_set_header_values_from_extradata(
     if (!additional_data_size) {
         // simple case, we don't have to go through local_params and just
         // set default fall-back values (for old extradata format).
-        header_params->tt_element_params = ttml_default_namespacing;
+        header_params->tt_element_params = TTML_DEFAULT_NAMESPACING;
         header_params->pre_body_elements = "";
 
         return 0;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

                 reply	other threads:[~2022-07-31  3:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB6PR0101MB22145B109621A6105512CA978F9B9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git