diff --git a/libav/grab.c b/libav/grab.c index 86a9ea07c6..0f9312c586 100644 --- a/libav/grab.c +++ b/libav/grab.c @@ -306,6 +306,10 @@ static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt) static int grab_read_close(AVFormatContext *s1) { VideoData *s = s1->priv_data; + + if (s->use_mmap) + munmap(video_buf, gb_buffers.size); + /* restore audio settings */ ioctl(s->fd, VIDIOCSAUDIO, &audio_saved);