diff options
author | Luca Abeni <lucabe72@email.it> | 2009-01-30 12:41:44 +0000 |
---|---|---|
committer | Luca Abeni <lucabe72@email.it> | 2009-01-30 12:41:44 +0000 |
commit | 5449a787c953f40f0f4312e6f5897775904ffc45 (patch) | |
tree | e1d1d558fd17f9eca47e44c978bc400f4b314b6f /libavdevice | |
parent | 73f184936def7ac93cca93bcbb7f205707ed2fdb (diff) | |
download | ffmpeg-5449a787c953f40f0f4312e6f5897775904ffc45.tar.gz |
If AVPacket->data == NULL, the packet does not contain any buffer to
be freed.
This fixes a double free on exit.
Originally committed as revision 16857 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavdevice')
-rw-r--r-- | libavdevice/v4l2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index b5f7db2885..819b6a5c1c 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -325,6 +325,10 @@ static void mmap_release_buffer(AVPacket *pkt) int res, fd; struct buff_data *buf_descriptor = pkt->priv; + if (pkt->data == NULL) { + return; + } + memset(&buf, 0, sizeof(struct v4l2_buffer)); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; |