The following issues were found
libobs/util/lexer.h
1 issues
Line: 150
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
static inline void base_token_copy(struct base_token *dst,
struct base_token *src)
{
memcpy(dst, src, sizeof(struct base_token));
}
/* ------------------------------------------------------------------------- */
#define LEX_ERROR 0
Reported by FlawFinder.
libobs/util/pipe-posix.c
1 issues
Line: 38
Column: 14
CWE codes:
78
Suggestion:
try using a library call that implements the same functionality if available
return NULL;
}
pipe.file = popen(cmd_line, type);
pipe.read_pipe = *type == 'r';
if (pipe.file == (FILE *)-1 || pipe.file == NULL) {
return NULL;
}
Reported by FlawFinder.
libobs/util/profiler.c
1 issues
Line: 388
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
call = &new_call.parent->children.array[idx];
} else {
call = bmalloc(sizeof(profile_call));
memcpy(call, &new_call, sizeof(profile_call));
}
thread_context = call;
call->start_time = os_gettime_ns();
}
Reported by FlawFinder.
libobs/util/simde/check.h
1 issues
Line: 68
Column: 3
CWE codes:
134
Suggestion:
Use a constant for the format specification
SIMDE_DIAGNOSTIC_DISABLE_VARIADIC_MACROS_
#if defined(EOF)
#define simde_errorf(format, ...) \
(fprintf(stderr, format, __VA_ARGS__), abort())
#else
#define simde_errorf(format, ...) (simde_trap())
#endif
HEDLEY_DIAGNOSTIC_POP
#endif
Reported by FlawFinder.
libobs/util/simde/simde-common.h
1 issues
Line: 608
Column: 36
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
#if !defined(SIMDE_NO_STRING_H)
#include <string.h>
#if !defined(simde_memcpy)
#define simde_memcpy(dest, src, n) memcpy(dest, src, n)
#endif
#if !defined(simde_memset)
#define simde_memset(s, c, n) memset(s, c, n)
#endif
#if !defined(simde_memcmp)
Reported by FlawFinder.
libobs/util/threading-posix.c
1 issues
Line: 265
Column: 6
CWE codes:
126
#elif defined(__FreeBSD__)
pthread_set_name_np(pthread_self(), name);
#elif defined(__GLIBC__) && !defined(__MINGW32__)
if (strlen(name) <= 15) {
pthread_setname_np(pthread_self(), name);
} else {
char *thread_name = bstrdup_n(name, 15);
pthread_setname_np(pthread_self(), thread_name);
bfree(thread_name);
Reported by FlawFinder.
plugins/coreaudio-encoder/windows-imports.h
1 issues
Line: 378
Column: 2
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
return false;
}
wchar_t path[MAX_PATH];
_snwprintf(path, MAX_PATH, L"%s\\%s", sh_path, subpath);
CoTaskMemFree(sh_path);
SetDllDirectory(path);
audio_toolbox = LoadLibraryW(L"CoreAudioToolbox.dll");
Reported by FlawFinder.
plugins/decklink/OBSVideoFrame.cpp
1 issues
Line: 16
CWE codes:
762
OBSVideoFrame::~OBSVideoFrame()
{
delete this->data;
}
HRESULT OBSVideoFrame::SetFlags(BMDFrameFlags newFlags)
{
flags = newFlags;
Reported by Cppcheck.
plugins/decklink/decklink-device-instance.cpp
1 issues
Line: 278
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
auto *outData =
(uint8_t *)bzalloc(sizeof(uint8_t) * cc_count * 3);
memcpy(outData, anc + reader.pos, cc_count * 3);
currentCaptions.data = outData;
currentCaptions.timestamp = timestamp;
currentCaptions.packets = cc_count;
Reported by FlawFinder.
plugins/decklink/decklink-device-mode.cpp
1 issues
Line: 80
Column: 9
CWE codes:
126
Suggestion:
This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it
equal = timeScale * den == frameDuration * num;
}
return equal;
}
void DeckLinkDeviceMode::SetMode(IDeckLinkDisplayMode *mode_)
{
IDeckLinkDisplayMode *old = mode;
Reported by FlawFinder.