diff options
author | Tuomas Virtanen <katajakasa@gmail.com> | 2016-01-16 15:30:01 +0200 |
---|---|---|
committer | Tuomas Virtanen <katajakasa@gmail.com> | 2016-01-16 15:30:01 +0200 |
commit | e7eeac0c0bdbbb501026530f5e228f8f5f464bcf (patch) | |
tree | ee304a2b9e64bce00b2b78a9b4c685809f64c418 /src | |
parent | 50ff4636012a24afafbf2563e158e54fcce7c26b (diff) |
Fix text copy leaks
Diffstat (limited to 'src')
-rw-r--r-- | src/kitplayer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kitplayer.c b/src/kitplayer.c index f022e1e..0ae228e 100644 --- a/src/kitplayer.c +++ b/src/kitplayer.c @@ -933,13 +933,13 @@ void Kit_GetPlayerInfo(const Kit_Player *player, Kit_PlayerInfo *info) { memset(info, 0, sizeof(Kit_PlayerInfo)); if(acodec_ctx != NULL) { - strncpy(info->acodec, acodec_ctx->codec->name, KIT_CODECMAX); - strncpy(info->acodec_name, acodec_ctx->codec->long_name, KIT_CODECNAMEMAX); + strncpy(info->acodec, acodec_ctx->codec->name, KIT_CODECMAX-1); + strncpy(info->acodec_name, acodec_ctx->codec->long_name, KIT_CODECNAMEMAX-1); memcpy(&info->audio, &player->aformat, sizeof(Kit_AudioFormat)); } if(vcodec_ctx != NULL) { - strncpy(info->vcodec, vcodec_ctx->codec->name, KIT_CODECMAX); - strncpy(info->vcodec_name, vcodec_ctx->codec->long_name, KIT_CODECNAMEMAX); + strncpy(info->vcodec, vcodec_ctx->codec->name, KIT_CODECMAX-1); + strncpy(info->vcodec_name, vcodec_ctx->codec->long_name, KIT_CODECNAMEMAX-1); memcpy(&info->video, &player->vformat, sizeof(Kit_VideoFormat)); } } |