aes1610: fix memory corruption introduced by a457658f1b
This commit is contained in:
parent
6e8d5cd6a1
commit
6664f87d8f
1 changed files with 8 additions and 5 deletions
|
@ -580,9 +580,12 @@ static void capture_read_strip_cb(struct libusb_transfer *transfer)
|
||||||
|
|
||||||
if (sum > 0) {
|
if (sum > 0) {
|
||||||
/* FIXME: would preallocating strip buffers be a decent optimization? */
|
/* FIXME: would preallocating strip buffers be a decent optimization? */
|
||||||
stripdata = g_malloc(128 * 4);
|
struct aes_stripe *stripe = g_malloc(FRAME_WIDTH * (FRAME_HEIGHT / 2) + sizeof(struct aes_stripe));
|
||||||
memcpy(stripdata, data + 1, 128 * 4);
|
stripe->delta_x = 0;
|
||||||
aesdev->strips = g_slist_prepend(aesdev->strips, stripdata);
|
stripe->delta_y = 0;
|
||||||
|
stripdata = stripe->data;
|
||||||
|
memcpy(stripdata, data + 1, FRAME_WIDTH * (FRAME_HEIGHT / 2));
|
||||||
|
aesdev->strips = g_slist_prepend(aesdev->strips, stripe);
|
||||||
aesdev->strips_len++;
|
aesdev->strips_len++;
|
||||||
aesdev->blanks_count = 0;
|
aesdev->blanks_count = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue