[FFmpeg-cvslog] lavc/dnxuc_parser: Use av_fourcc2str instead of av_fourcc_make_string

Alexander Strasser git at videolan.org
Sun Oct 13 23:59:27 EEST 2024


ffmpeg | branch: master | Alexander Strasser <eclipse7 at gmx.net> | Sat Oct 12 19:38:44 2024 +0200| [b0ea76c9d1e76fb62a685a00ba153ed7a1eb309b] | committer: Alexander Strasser

lavc/dnxuc_parser: Use av_fourcc2str instead of av_fourcc_make_string

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 .

Using av_fourcc2str uses the correct buffer size and moves the
buffer into a nested scope while also being shorter.

Fixes: CID 1632380
Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>

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

 libavcodec/dnxuc_parser.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavcodec/dnxuc_parser.c b/libavcodec/dnxuc_parser.c
index 55d576345c..12472c7a2d 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,9 +95,8 @@ static int dnxuc_parse(AVCodecParserContext *s,
     pc->nr_bytes = AV_RL32(buf+29+icmp_offset) - 8;
 
     if (!avctx->codec_tag) {
-        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,
+            av_fourcc2str(pc->fourcc_tag),
             pc->width, pc->height,
             (pc->nr_bytes*8)/(pc->width*pc->height),
             pc->nr_bytes);



More information about the ffmpeg-cvslog mailing list