Fix for Qt GUI Avi codec save settings to support max file path.

This commit is contained in:
harry 2023-01-23 22:26:56 -05:00
parent 41878d95ef
commit 01821d89b5
1 changed files with 7 additions and 3 deletions

View File

@ -860,7 +860,9 @@ int loadCodecConfig( int type, const char *codec_name, AVCodecContext *ctx)
FILE *fp;
const char *baseDir = FCEUI_GetBaseDirectory();
sprintf( filename, "%s/avi/%s.conf", baseDir, codec_name );
snprintf( filename, sizeof(filename), "%s/avi/%s.conf", baseDir, codec_name );
filename[sizeof(filename)-1] = 0;
fp = fopen( filename, "r");
@ -991,12 +993,14 @@ int saveCodecConfig( int type, const char *codec_name, AVCodecContext *ctx)
void *obj, *child = NULL;
FILE *fp;
uint8_t *str;
char filename[512];
char filename[4096];
const AVOption *opt;
bool useOpt;
const char *baseDir = FCEUI_GetBaseDirectory();
sprintf( filename, "%s/avi/%s.conf", baseDir, codec_name );
snprintf( filename, sizeof(filename), "%s/avi/%s.conf", baseDir, codec_name );
filename[sizeof(filename)-1] = 0;
fp = fopen( filename, "w");