[MPlayer-cvslog] r38368 - trunk/libvo/vo_v4l2.c

reimar subversion at mplayerhq.hu
Thu Jun 2 22:20:49 EEST 2022


Author: reimar
Date: Thu Jun  2 22:20:49 2022
New Revision: 38368

Log:
libvo/vo_v4l2.c: set pointer to NULL after free.

Missed in previous patch due to extra whitespace.

Should fix trac issue #2387 for real.

Modified:
   trunk/libvo/vo_v4l2.c

Modified: trunk/libvo/vo_v4l2.c
==============================================================================
--- trunk/libvo/vo_v4l2.c	Wed Jun  1 21:19:04 2022	(r38367)
+++ trunk/libvo/vo_v4l2.c	Thu Jun  2 22:20:49 2022	(r38368)
@@ -117,6 +117,7 @@ preinit (const char *arg)
   if (v4l2_fd < 0)
   {
     free (device);
+    device = NULL;
     mp_msg (MSGT_VO, MSGL_FATAL, "%s %s\n", V4L2_VO_HDR, strerror (errno));
     return -1;
   }
@@ -129,6 +130,7 @@ preinit (const char *arg)
   if (ioctl (v4l2_fd, VIDIOC_G_EXT_CTRLS, &ctrls) < 0)
   {
     free (device);
+    device = NULL;
     mp_msg (MSGT_OPEN, MSGL_FATAL, "%s %s\n", V4L2_VO_HDR, strerror (errno));
     return -1;
   }
@@ -147,6 +149,7 @@ preinit (const char *arg)
   {
     mp_msg (MSGT_VO, MSGL_INFO, "none\n");
     free (device);
+    device = NULL;
     return -1;
   }
   else
@@ -160,6 +163,7 @@ preinit (const char *arg)
       mp_msg (MSGT_VO, MSGL_ERR,
               "%s can't set output (%s)\n", V4L2_VO_HDR, strerror (errno));
       free (device);
+      device = NULL;
       return -1;
     }
   }
@@ -167,6 +171,7 @@ preinit (const char *arg)
   /* display device name */
   mp_msg (MSGT_VO, MSGL_INFO, "%s using %s\n", V4L2_VO_HDR, device);
   free (device);
+  device = NULL;
 
   /* display current video output */
   if (ioctl (v4l2_fd, VIDIOC_G_OUTPUT, &output) == 0)


More information about the MPlayer-cvslog mailing list