diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-20 11:36:58 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-20 11:36:58 +0300 |
commit | 75c9fe428fa8ed1dec093de6a7b2dc6ca042f6d6 (patch) | |
tree | 7c7c2ea8da401497a63fa7f66cdbe6756b039958 /extern/libopenjpeg/event.c | |
parent | 81a477f4dc999918ba66413a286f5a0b1c0c4e79 (diff) |
Update bundled openjpeg from 1.5.0 to 1.5.2
Solves following issues:
- Quite reasonable amount of paranoid warnings were solved by an upstream
- Upstream seems to have all fixes needed for FreeBSD and OSX already
- Brings all fixes and such from upstream
Diffstat (limited to 'extern/libopenjpeg/event.c')
-rw-r--r-- | extern/libopenjpeg/event.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/extern/libopenjpeg/event.c b/extern/libopenjpeg/event.c index 0dc22f12549..38db33a9432 100644 --- a/extern/libopenjpeg/event.c +++ b/extern/libopenjpeg/event.c @@ -103,18 +103,17 @@ opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, .. va_list arg; int str_length/*, i, j*/; /* UniPG */ char message[MSG_SIZE]; - memset(message, 0, MSG_SIZE); /* initialize the optional parameter list */ va_start(arg, fmt); - /* check the length of the format string */ - str_length = (strlen(fmt) > MSG_SIZE) ? MSG_SIZE : strlen(fmt); /* parse the format string and put the result in 'message' */ - vsprintf(message, fmt, arg); /* UniPG */ + str_length = vsnprintf(message, MSG_SIZE, fmt, arg); /* UniPG */ /* deinitialize the optional parameter list */ va_end(arg); /* output the message to the user program */ - msg_handler(message, cinfo->client_data); + if( str_length > -1 && str_length < MSG_SIZE ) + msg_handler(message, cinfo->client_data); + else return OPJ_FALSE; } return OPJ_TRUE; |