diff --git a/src/telev/telev.c b/src/telev/telev.c index ea529eb..378f35e 100644 --- a/src/telev/telev.c +++ b/src/telev/telev.c @@ -49,6 +49,7 @@ enum { EVENT_END = 0xff, PAYLOAD_SIZE = 4, VOLUME = 10, + QUEUE_SIZE = 8192, }; @@ -192,6 +193,9 @@ int telev_send(struct telev *tel, int event, bool end) if (!tel) return EINVAL; + if (tel->mb->end >= QUEUE_SIZE) + return EOVERFLOW; + pos = tel->mb->pos; tel->mb->pos = tel->mb->end;