X-Git-Url: https://git.piment-noir.org/?p=deb_xorg-server.git;a=blobdiff_plain;f=debian%2Fpatches%2Fxi2-resize-touch.patch;fp=debian%2Fpatches%2Fxi2-resize-touch.patch;h=021dd59b549e0734d33b4a4ecf3345ae7b226afe;hp=0000000000000000000000000000000000000000;hb=7217e0ca50bba73dad94782e67980aeeb24ab693;hpb=a09e091a5c996d46a398abb27b06fe504591673f diff --git a/debian/patches/xi2-resize-touch.patch b/debian/patches/xi2-resize-touch.patch new file mode 100644 index 0000000..021dd59 --- /dev/null +++ b/debian/patches/xi2-resize-touch.patch @@ -0,0 +1,34 @@ +diff --git a/dix/touch.c b/dix/touch.c +index a7ea213..1478e38 100644 +--- a/dix/touch.c ++++ b/dix/touch.c +@@ -460,12 +460,26 @@ TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev) + if (ev->flags & (TOUCH_CLIENT_ID | TOUCH_REPLAYING)) + return; + ++ if (ti->history_elements == ti->history_size - 1) { ++ DeviceEvent *hist = NULL; ++ size_t sz = ti->history_size * 2; ++ ++ if (sz < 10000) { ++ hist = realloc(ti->history, sz * sizeof(*hist)); ++ ++ if (hist) { ++ ti->history = hist; ++ ti->history_size = sz; ++ memset(&hist[sz/2], 0, sizeof(*hist)*sz/2); ++ } ++ } ++ } ++ + ti->history[ti->history_elements++] = *ev; +- /* FIXME: proper overflow fixes */ + if (ti->history_elements > ti->history_size - 1) { + ti->history_elements = ti->history_size - 1; +- DebugF("source device %d: history size %d overflowing for touch %u\n", +- ti->sourceid, ti->history_size, ti->client_id); ++ ErrorF("source device %d: history size %d overflowing for touch %u\n", ++ ti->sourceid, ti->history_size, ti->client_id); + } + } +