[FFmpeg-cvslog] lavd/libdc1394: Do not crash if dc1394_camera_new() fails.

Carl Eugen Hoyos git at videolan.org
Fri Aug 18 20:21:49 EEST 2017


ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Fri Aug 18 19:20:15 2017 +0200| [285c015f1077a1d357dacdccc22ab02fd4aefe0a] | committer: Carl Eugen Hoyos

lavd/libdc1394: Do not crash if dc1394_camera_new() fails.

Fixes Ubuntu bug 1710849

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=285c015f1077a1d357dacdccc22ab02fd4aefe0a
---

 libavdevice/libdc1394.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c
index afffd89a8b..003335fdd8 100644
--- a/libavdevice/libdc1394.c
+++ b/libavdevice/libdc1394.c
@@ -190,6 +190,14 @@ static int dc1394_read_header(AVFormatContext *c)
 
     /* FIXME: To select a specific camera I need to search in list its guid */
     dc1394->camera = dc1394_camera_new (dc1394->d, list->ids[0].guid);
+
+    if (!dc1394->camera) {
+         av_log(c, AV_LOG_ERROR, "Unable to open camera with guid 0x%"PRIx64"\n",
+                list->ids[0].guid);
+         dc1394_camera_free_list(list);
+         goto out;
+    }
+
     if (list->num > 1) {
         av_log(c, AV_LOG_INFO, "Working with the first camera found\n");
     }



More information about the ffmpeg-cvslog mailing list