0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

obs-webrtc: Add null terminator to codec array

This fixes an issue where, when the MAX_CODECS length was equal to the
amount of supported codecs (3), it would leave the list without a null
terminator and crash when iterating over the elements.
This commit is contained in:
John Bradley 2024-04-29 12:12:46 -05:00 committed by tt2468
parent fa482b6b49
commit 627308bd53
2 changed files with 2 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#include "whip-service.h"
const char *audio_codecs[MAX_CODECS] = {"opus"};
const char *video_codecs[MAX_CODECS] = {"h264", "hevc", "av1"};
const char *audio_codecs[] = {"opus", nullptr};
const char *video_codecs[] = {"h264", "hevc", "av1", nullptr};
WHIPService::WHIPService(obs_data_t *settings, obs_service_t *)
: server(),

View File

@ -2,8 +2,6 @@
#include <obs-module.h>
#include <string>
#define MAX_CODECS 3
struct WHIPService {
std::string server;
std::string bearer_token;