The following issues were found

libobs/graphics/device-exports.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 169 Column: 17 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

              EXPORT void device_projection_push(gs_device_t *device);
EXPORT void device_projection_pop(gs_device_t *device);
EXPORT void device_debug_marker_begin(gs_device_t *device,
				      const char *markername,
				      const float color[4]);
EXPORT void device_debug_marker_end(gs_device_t *device);

#if __linux__


            

Reported by FlawFinder.

libobs/graphics/graphics-internal.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 269 Column: 14 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

              	bool (*device_nv12_available)(gs_device_t *device);

	void (*device_debug_marker_begin)(gs_device_t *device,
					  const char *markername,
					  const float color[4]);
	void (*device_debug_marker_end)(gs_device_t *device);

#ifdef __APPLE__
	/* OSX/Cocoa specific functions */

            

Reported by FlawFinder.

libobs/graphics/graphics-magick.c
1 issues
strcpy - Does not check for buffer overflows when copying to destination [MS-banned]
Security

Line: 38 Column: 2 CWE codes: 120
Suggestion: Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)

              	info = CloneImageInfo(NULL);
	exception = AcquireExceptionInfo();

	strcpy(info->filename, file);
	image = ReadImage(info, exception);
	if (image) {
		size_t cx = image->magick_columns;
		size_t cy = image->magick_rows;
		data = bmalloc(cx * cy * 4);

            

Reported by FlawFinder.

libobs/media-io/audio-io.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 367 Column: 2 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              	if (!out)
		goto fail;

	memcpy(&out->info, info, sizeof(struct audio_output_info));
	out->channels = get_audio_channels(info->speakers);
	out->planes = planar ? out->channels : 1;
	out->input_cb = info->input_callback;
	out->input_param = info->input_param;
	out->block_size = (planar ? 1 : out->channels) *

            

Reported by FlawFinder.

libobs/obs-encoder.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 1320 Column: 2 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              	p_refs = bmalloc(src->size + sizeof(long));
	dst->data = (void *)(p_refs + 1);
	*p_refs = 1;
	memcpy(dst->data, src->data, src->size);
}

/* OBS_DEPRECATED */
void obs_duplicate_encoder_packet(struct encoder_packet *dst,
				  const struct encoder_packet *src)

            

Reported by FlawFinder.

libobs/obs-hotkey.c
1 issues
Using argument idx that points at uninitialized variable idx
Error

Line: 978 CWE codes: 908

              
static inline bool find_binding(obs_hotkey_id id, size_t *idx)
{
	struct binding_find_data data = {id, idx, false};
	enum_bindings(binding_finder, &data);
	return data.found;
}

static inline void release_pressed_binding(obs_hotkey_binding_t *binding);

            

Reported by Cppcheck.

libobs/obs-nix-x11.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 1085 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

              static bool get_key_translation(struct dstr *dstr, xcb_keycode_t keycode)
{
	xcb_connection_t *connection;
	char name[128];

	connection = XGetXCBConnection(obs->hotkeys.platform_context->display);

	XKeyEvent event = {0};
	event.type = KeyPress;

            

Reported by FlawFinder.

libobs/obs-output.c
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 2577 Column: 18 CWE codes: 126

              		return;

	// split text into 32 character strings
	int size = (int)strlen(text);
	blog(LOG_DEBUG, "Caption text: %s", text);

	pthread_mutex_lock(&output->caption_mutex);

	output->caption_tail =

            

Reported by FlawFinder.

libobs/obs-source-transition.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 1004 Column: 4 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              					      min_ts, mixers, channels,
					      sample_rate, mix_b);
		} else if (state.s[0]) {
			memcpy(audio->output[0].data[0],
			       state.s[0]->audio_output_buf[0][0],
			       TOTAL_AUDIO_SIZE);
		}

		obs_source_release(state.s[0]);

            

Reported by FlawFinder.

libobs/util/cf-lexer.h
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 62 Column: 2 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              static inline void cf_token_copy(struct cf_token *dst,
				 const struct cf_token *src)
{
	memcpy(dst, src, sizeof(struct cf_token));
}

static inline void cf_token_add(struct cf_token *dst,
				const struct cf_token *add)
{

            

Reported by FlawFinder.