summaryrefslogtreecommitdiff
path: root/coders/dpx.c
diff options
context:
space:
mode:
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++;
}
}