This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-utils.git tree:

Subject: qv4l2: fix memory corruption and a wrong close sequence
Author:  Hans Verkuil <[email protected]>
Date:    Mon Apr 5 17:38:35 2010 +0200

When allocating memory for a string control the wrong size was used.

When closing the video device (e.g. during exit) the signal mapper was
deleted after the dialog was destroyed. This caused lostFocus events to arrive
in the signal mapper's handler which then tried to access the already closed
video device. And that caused a confusing error message to appear.

This is now fixed by deleting the signal mapper first.

Signed-off-by: Hans Verkuil <[email protected]>

 utils/qv4l2/ctrl-tab.cpp |    2 +-
 utils/qv4l2/qv4l2.cpp    |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=e2e0dfdc3bd3da5e24f356356413b0658346b580

diff --git a/utils/qv4l2/ctrl-tab.cpp b/utils/qv4l2/ctrl-tab.cpp
index 1165d85..6112e99 100644
--- a/utils/qv4l2/ctrl-tab.cpp
+++ b/utils/qv4l2/ctrl-tab.cpp
@@ -539,7 +539,7 @@ void ApplicationWindow::refresh(unsigned ctrl_class)
                        continue;
                if (m_ctrlMap[id].type == V4L2_CTRL_TYPE_STRING) {
                        c[cnt].size = m_ctrlMap[id].maximum + 1;
-                       c[cnt].string = (char *)malloc(c[i].size);
+                       c[cnt].string = (char *)malloc(c[cnt].size);
                }
                cnt++;
        }
diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp
index 61a7ab6..835c00c 100644
--- a/utils/qv4l2/qv4l2.cpp
+++ b/utils/qv4l2/qv4l2.cpp
@@ -438,6 +438,8 @@ void ApplicationWindow::capStart(bool start)
 
 void ApplicationWindow::closeDevice()
 {
+       delete m_sigMapper;
+       m_sigMapper = NULL;
        m_capStartAct->setEnabled(false);
        m_capStartAct->setChecked(false);
        if (fd() >= 0) {
@@ -457,8 +459,6 @@ void ApplicationWindow::closeDevice()
                m_tabs->removeTab(0);
                delete page;
        }
-       delete m_sigMapper;
-       m_sigMapper = NULL;
        m_ctrlMap.clear();
        m_widgetMap.clear();
        m_classMap.clear();

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to