Commit 339132e9 authored by lucabe's avatar lucabe

If AVPacket->data == NULL, the packet does not contain any buffer to

be freed.
This fixes a double free on exit.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16857 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent fc798190
...@@ -325,6 +325,10 @@ static void mmap_release_buffer(AVPacket *pkt) ...@@ -325,6 +325,10 @@ static void mmap_release_buffer(AVPacket *pkt)
int res, fd; int res, fd;
struct buff_data *buf_descriptor = pkt->priv; struct buff_data *buf_descriptor = pkt->priv;
if (pkt->data == NULL) {
return;
}
memset(&buf, 0, sizeof(struct v4l2_buffer)); memset(&buf, 0, sizeof(struct v4l2_buffer));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP; buf.memory = V4L2_MEMORY_MMAP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment