summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2017-01-22 21:18:20 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2017-01-22 21:18:20 +0200
commit79310fa59601cc90b0b6652854f13096fe9c75cb (patch)
treef9cec70ef085dd422c12269c476029197134b8e0
parentc5ed3de2633965c9f338ae3b3d9e7b4f71dd9906 (diff)
Fix header size sanity check
-rw-r--r--glcapture.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/glcapture.c b/glcapture.c
index 245b2d8..a4e6c35 100644
--- a/glcapture.c
+++ b/glcapture.c
@@ -148,7 +148,8 @@ write_data_unsafe(struct fifo *fifo, const struct frame_info *info, const void *
uint8_t header[255] = { 'r', 'a', 'w', 'm', 'u', 'x' };
- if (strlen(info->video.format) + strlen(info->audio.format) + 31 > sizeof(header)) {
+ if (strlen(fifo->stream[STREAM_VIDEO].info.video.format) +
+ strlen(fifo->stream[STREAM_AUDIO].info.audio.format) + 32 > sizeof(header)) {
warnx("something went wrong");
reset_fifo(fifo);
return;