]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
If AVPacket->data == NULL, the packet does not contain any buffer to
authorlucabe <lucabe@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 30 Jan 2009 12:41:44 +0000 (12:41 +0000)
committerlucabe <lucabe@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 30 Jan 2009 12:41:44 +0000 (12:41 +0000)
be freed.
This fixes a double free on exit.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16857 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavdevice/v4l2.c

index b5f7db2885375e034faaf27ee398008a6330999d..819b6a5c1c66c50d2d4bb95dbaa5ac58360a2af3 100644 (file)
@@ -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;