diff mbox series

[FFmpeg-devel,1/2] lavc/dnxuc_parser: Adhere to av_fourcc_make_string API

Message ID a48eec704a36b4f577a41f74001c975929fce42b.1728766582.git.eclipse7@gmx.net
State New
Headers show
Series [FFmpeg-devel,1/2] lavc/dnxuc_parser: Adhere to av_fourcc_make_string API | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Alexander Strasser Oct. 12, 2024, 9:04 p.m. UTC
The documentation of av_fourcc_make_string states the passed in
buffer must be of at least the size of  AV_FOURCC_MAX_STRING_SIZE

Also move the buffer into inner scope where it is used.

Fixes: CID 1632380
---
 libavcodec/dnxuc_parser.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
diff mbox series

Patch

diff --git a/libavcodec/dnxuc_parser.c b/libavcodec/dnxuc_parser.c
index 55d576345c..896758c794 100644
--- a/libavcodec/dnxuc_parser.c
+++ b/libavcodec/dnxuc_parser.c
@@ -68,7 +68,6 @@  static int dnxuc_parse(AVCodecParserContext *s,
                     const uint8_t **poutbuf, int *poutbuf_size,
                     const uint8_t *buf, int buf_size)
 {
-    char fourcc_buf[5];
     const int HEADER_SIZE = 37;
     int icmp_offset = 0;

@@ -96,6 +95,8 @@  static int dnxuc_parse(AVCodecParserContext *s,
     pc->nr_bytes = AV_RL32(buf+29+icmp_offset) - 8;

     if (!avctx->codec_tag) {
+        char fourcc_buf[AV_FOURCC_MAX_STRING_SIZE];
+
         av_fourcc_make_string(fourcc_buf, pc->fourcc_tag);
         av_log(avctx, AV_LOG_INFO, "dnxuc_parser: '%s' %dx%d %dbpp %d\n",
             fourcc_buf,