summaryrefslogtreecommitdiff
path: root/coders/dpx.c
diff options
context:
space:
mode:
authorJiyong <jiyong.min@samsung.com>2023-12-06 10:30:38 +0900
committerJiyong <jiyong.min@samsung.com>2023-12-06 10:31:10 +0900
commit2c17c6b7ecf6d96c9b4004cd7b79d860b66e6ae3 (patch)
treec2510f971c95cb79f5a4bd55c841d294bf5197fd /coders/dpx.c
parent043c171f3b5935329641967057ae5f45bc1a5631 (diff)
downloadGraphicsMagick-upstream.tar.gz
GraphicsMagick-upstream.tar.bz2
GraphicsMagick-upstream.zip
Imported Upstream version 1.3.42upstream/1.3.42upstream
Change-Id: I4f2a12cbf50e1a459e7bac7c5a8e374071620eea
Diffstat (limited to 'coders/dpx.c')
-rw-r--r--coders/dpx.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/coders/dpx.c b/coders/dpx.c
index f9a2897..f305ccf 100644
--- a/coders/dpx.c
+++ b/coders/dpx.c
@@ -1,5 +1,5 @@
/*
-% Copyright (C) 2005-2021 GraphicsMagick Group
+% Copyright (C) 2005-2022 GraphicsMagick Group
%
% This program is covered by multiple licenses, which are described in
% Copyright.txt. You should have received a copy of Copyright.txt with this
@@ -531,7 +531,7 @@ STATIC unsigned int IsDPX(const unsigned char *magick,const size_t length)
\
if (!IS_UNDEFINED_U32(member)) \
{ \
- SMPTEBitsToString(member,buffer_); \
+ SMPTEBitsToString(member,buffer_,sizeof(buffer_)); \
(void) SetImageAttribute(image,name,buffer_); \
LogSetImageAttribute(name,buffer_); \
} \
@@ -622,7 +622,7 @@ STATIC void SwabDPXTVInfo(DPXTVInfo *tv_info)
MagickSwabFloat(&tv_info->white_level.f);
MagickSwabFloat(&tv_info->integration_time.f);
}
-STATIC void SMPTEBitsToString(const U32 value, char *str)
+STATIC void SMPTEBitsToString(const U32 value, char *str, size_t str_length)
{
unsigned int
pos,
@@ -630,11 +630,11 @@ STATIC void SMPTEBitsToString(const U32 value, char *str)
for (pos=8; pos != 0; pos--, shift -= 4)
{
- (void) sprintf(str,"%01u",(unsigned int) ((value >> shift) & 0x0fU));
+ (void) snprintf(str,3,"%01u",(unsigned int) ((value >> shift) & 0x0fU));
str += 1;
if ((pos > 2) && (pos % 2))
{
- (void) strcat(str,":");
+ (void) strlcat(str,":",str_length);
str++;
}
}