From 79310fa59601cc90b0b6652854f13096fe9c75cb Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Sun, 22 Jan 2017 21:18:20 +0200 Subject: Fix header size sanity check --- glcapture.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2