diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2017-01-22 21:18:20 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2017-01-22 21:18:20 +0200 |
commit | 79310fa59601cc90b0b6652854f13096fe9c75cb (patch) | |
tree | f9cec70ef085dd422c12269c476029197134b8e0 | |
parent | c5ed3de2633965c9f338ae3b3d9e7b4f71dd9906 (diff) |
Fix header size sanity check
-rw-r--r-- | glcapture.c | 3 |
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; |