The following issues were found

libobs/audio-monitoring/win32/wasapi-output.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

              			while (cur < end)
				*(cur++) *= vol;
		}
		memcpy(output, resample_data[0],
		       resample_frames * monitor->channels * sizeof(float));
	}

	render->lpVtbl->ReleaseBuffer(render, resample_frames,
				      muted ? AUDCLNT_BUFFERFLAGS_SILENT : 0);

            

Reported by FlawFinder.

wchar_t - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 299 Column: 3 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

              		hr = immde->lpVtbl->GetDefaultAudioEndpoint(
			immde, eRender, eConsole, &monitor->device);
	} else {
		wchar_t w_id[512];
		os_utf8_to_wcs(id, 0, w_id, 512);

		hr = immde->lpVtbl->GetDevice(immde, w_id, &monitor->device);
	}


            

Reported by FlawFinder.

deps/jansson/src/jansson.h
2 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 138 Column: 5 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

                  int line;
    int column;
    int position;
    char source[JSON_ERROR_SOURCE_LENGTH];
    char text[JSON_ERROR_TEXT_LENGTH];
} json_error_t;


/* getters, setters, manipulation */

            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 139 Column: 5 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

                  int column;
    int position;
    char source[JSON_ERROR_SOURCE_LENGTH];
    char text[JSON_ERROR_TEXT_LENGTH];
} json_error_t;


/* getters, setters, manipulation */


            

Reported by FlawFinder.

plugins/obs-outputs/ftl-stream.c
2 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: 1052 Column: 44 CWE codes: 126

              	obs_data_t *video_settings = obs_encoder_get_settings(video_encoder);

	ingest_url = obs_service_get_url(service);
	if (strncmp(ingest_url, FTL_URL_PROTOCOL, strlen(FTL_URL_PROTOCOL)) ==
	    0) {
		dstr_copy(&stream->path, ingest_url + strlen(FTL_URL_PROTOCOL));
	} else {
		dstr_copy(&stream->path, ingest_url);
	}

            

Reported by FlawFinder.

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: 1054 Column: 41 CWE codes: 126

              	ingest_url = obs_service_get_url(service);
	if (strncmp(ingest_url, FTL_URL_PROTOCOL, strlen(FTL_URL_PROTOCOL)) ==
	    0) {
		dstr_copy(&stream->path, ingest_url + strlen(FTL_URL_PROTOCOL));
	} else {
		dstr_copy(&stream->path, ingest_url);
	}

	key = obs_service_get_key(service);

            

Reported by FlawFinder.

plugins/obs-outputs/flv-mux.c
2 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

              
void write_file_info(FILE *file, int64_t duration_ms, int64_t size)
{
	char buf[64];
	char *enc = buf;
	char *end = enc + sizeof(buf);

	fseek(file, FLV_INFO_SIZE_OFFSET, SEEK_SET);


            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

              	obs_encoder_t *aencoder = obs_output_get_audio_encoder(context, 0);
	video_t *video = obs_encoder_video(vencoder);
	audio_t *audio = obs_encoder_audio(aencoder);
	char buf[4096];
	char *enc = buf;
	char *end = enc + sizeof(buf);
	struct dstr encoder_name = {0};

	enc_str(&enc, end, "@setDataFrame");

            

Reported by FlawFinder.

plugins/obs-filters/rnnoise/src/rnn.c
2 issues
Null pointer dereference: (int*)0
Error

Line: 105 CWE codes: 476

                    for (i=0;i<N;i++)
         output[i] = relu(output[i]);
   } else {
     *(int*)0=0;
   }
}

static void compute_gru(const GRULayer *gru, float *state, const float *input)
{

            

Reported by Cppcheck.

Null pointer dereference: (int*)0
Error

Line: 151 CWE codes: 476

                    if (gru->activation == ACTIVATION_SIGMOID) sum = sigmoid_approx(WEIGHTS_SCALE*sum);
      else if (gru->activation == ACTIVATION_TANH) sum = tansig_approx(WEIGHTS_SCALE*sum);
      else if (gru->activation == ACTIVATION_RELU) sum = relu(WEIGHTS_SCALE*sum);
      else *(int*)0=0;
      h[i] = z[i]*state[i] + (1-z[i])*sum;
   }
   for (i=0;i<N;i++)
      state[i] = h[i];
}

            

Reported by Cppcheck.

deps/jansson/src/memory.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

                  if(!new_str)
        return NULL;

    memcpy(new_str, str, len);
    new_str[len] = '\0';
    return new_str;
}

void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn)

            

Reported by FlawFinder.

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: 41 Column: 31 CWE codes: 126

              
char *jsonp_strdup(const char *str)
{
    return jsonp_strndup(str, strlen(str));
}

char *jsonp_strndup(const char *str, size_t len)
{
    char *new_str;

            

Reported by FlawFinder.

libobs/graphics/image-file.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

              							 area);
			}

			memcpy(image->animation_frame_cache[new_frame],
			       image->gif.frame_image, area * 4);

			image->last_decoded_frame = new_frame;
		}
	}

            

Reported by FlawFinder.

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: 207 Column: 8 CWE codes: 126

              	if (!file)
		return;

	len = strlen(file);

	if (len > 4 && strcmp(file + len - 4, ".gif") == 0) {
		if (init_animated_gif(image, file, mem_usage, alpha_mode)) {
			return;
		}

            

Reported by FlawFinder.

libobs/graphics/libnsgif/libnsgif.c
2 issues
fprintf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 24 Column: 23 CWE codes: 134
Suggestion: Use a constant for the format specification

              #ifdef NDEBUG
#  define LOG(x) ((void) 0)
#else
#  define LOG(x) do { fprintf(stderr, x), fputc('\n', stderr); } while (0)
#endif /* NDEBUG */



/*    READING GIF FILES

            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 332 Column: 24 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

              
            entry[0] = 0x00000000;
            /* Force Alpha channel to opaque */
            ((unsigned char *) entry)[3] = 0xff;

            entry[1] = 0xffffffff;
        }
    }


            

Reported by FlawFinder.

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

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

                  /*    General LZW values. They are NO LONGER shared for all GIFs being decoded BECAUSE
          THAT IS A TERRIBLE IDEA TO SAVE 10Kb or so per GIF.
    */
    unsigned char buf[4];
    unsigned char *direct;

    int table[2][(1 << GIF_MAX_LZW)];
    unsigned char stack[(1 << GIF_MAX_LZW) * 2];
    unsigned char *stack_pointer;

            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

                  unsigned char *direct;

    int table[2][(1 << GIF_MAX_LZW)];
    unsigned char stack[(1 << GIF_MAX_LZW) * 2];
    unsigned char *stack_pointer;
    int code_size, set_code_size;
    int max_code, max_code_size;
    int clear_code, end_code;
    int curbit, lastbit, last_byte;

            

Reported by FlawFinder.

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

Line: 237 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 video_output_info));
	out->frame_time =
		util_mul_div64(1000000000ULL, info->fps_den, info->fps_num);
	out->initialized = false;

	if (pthread_mutexattr_init(&attr) != 0)

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

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

              		cfi->count = count;
		cfi->skipped = 0;

		memcpy(frame, &cfi->frame, sizeof(*frame));

		locked = true;
	}

	pthread_mutex_unlock(&video->data_mutex);

            

Reported by FlawFinder.