summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavdevice/v4l2.c4
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;