From 8f7a19f2e34a2668c500792f93ee594b29d99192 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 16 Aug 2017 13:32:08 +0200 Subject: [PATCH] examples: fix some leaks --- src/examples/export-sink.c | 2 +- src/examples/local-v4l2.c | 2 +- src/examples/video-play.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/examples/export-sink.c b/src/examples/export-sink.c index ffdb0e19c..2a9b34bed 100644 --- a/src/examples/export-sink.c +++ b/src/examples/export-sink.c @@ -408,7 +408,7 @@ static int impl_node_process_input(void *data) SDL_RenderPresent(d->renderer); if (map) - munmap(map, buf->datas[0].maxsize); + munmap(map, buf->datas[0].maxsize + buf->datas[0].mapoffset); handle_events(d); diff --git a/src/examples/local-v4l2.c b/src/examples/local-v4l2.c index 512cd2b85..79b340b9f 100644 --- a/src/examples/local-v4l2.c +++ b/src/examples/local-v4l2.c @@ -389,7 +389,7 @@ static int impl_node_process_input(void *data) SDL_RenderPresent(d->renderer); if (map) - munmap(map, buf->datas[0].maxsize); + munmap(map, buf->datas[0].maxsize + buf->datas[0].mapoffset); handle_events(d); diff --git a/src/examples/video-play.c b/src/examples/video-play.c index 430bd7736..5e8c5206b 100644 --- a/src/examples/video-play.c +++ b/src/examples/video-play.c @@ -142,7 +142,7 @@ on_stream_new_buffer(void *_data, uint32_t id) SDL_RenderPresent(data->renderer); if (map) - munmap(map, buf->datas[0].maxsize); + munmap(map, buf->datas[0].maxsize + buf->datas[0].mapoffset); pw_stream_recycle_buffer(stream, id);