Skip to content

Commit

Permalink
(mp4) avoid possibility to overflow string length using environment v…
Browse files Browse the repository at this point in the history
…ariable
  • Loading branch information
danieljprice committed Nov 28, 2023
1 parent c4f82a5 commit 570e6c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/giza-driver-mp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ _giza_close_device_mp4 (int last)
char *flagsToUse = userFlags ? userFlags : GIZA_FFMPEG_FLAGS_DEFAULT;

/* construct ffmpeg command and repeat it to the user */
char command[512]; /* Adjust size as needed */
int mylen = strlen(Dev[id].prefix) + strlen(flagsToUse) + strlen(fileName) + 50;
char command[mylen + 1];
sprintf(command, "ffmpeg -i %s_%%04d.png %s %s", Dev[id].prefix,flagsToUse,fileName);
_giza_message(command);

Expand Down

0 comments on commit 570e6c6

Please sign in to comment.