Hi!

Attached patch - that I cannot test - is meant to fix a bug reported
at launchpad:
https://bugs.launchpad.net/ubuntu/+source/ffmpeg/+bug/1710849

Please comment, Carl Eugen
From 6db6b36a36da95de9b2bae34313710df5b126811 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffm...@gmail.com>
Date: Fri, 18 Aug 2017 09:56:08 +0200
Subject: [PATCH] lavd/libdc1394: Do not crash if dc1394_camera_new() fails.

Fixes Ubuntu bug 1710849
---
 libavdevice/libdc1394.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c
index afffd89..f435856 100644
--- a/libavdevice/libdc1394.c
+++ b/libavdevice/libdc1394.c
@@ -190,6 +190,13 @@ 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);
+         goto out;
+    }
+
     if (list->num > 1) {
         av_log(c, AV_LOG_INFO, "Working with the first camera found\n");
     }
-- 
1.7.10.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to