summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin JOLY <kevin.joly@heig-vd.ch>2019-11-04 15:39:59 +0100
committerKevin Joly <joly.kevin25@gmail.com>2019-11-04 16:14:05 +0100
commit9e56619b10e741dc7ffaba63c3001536fe3a8b66 (patch)
tree690a1f0c4413f8d28ee8df04dc729eee68e3223b
parent07f33470b34c6677b614e543a6d8f8cf0a7ce7e3 (diff)
avdemux: Fix segmentation fault if long_name is NULL
Some plugins (like libcdio) registers empty long_name field. Calling strncmp on this field leads to a segmentation fault. Signed-off-by: Kevin Joly <joly.kevin25@gmail.com>
-rw-r--r--ext/libav/gstavdemux.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/libav/gstavdemux.c b/ext/libav/gstavdemux.c
index 3b74f92..fa5fd4e 100644
--- a/ext/libav/gstavdemux.c
+++ b/ext/libav/gstavdemux.c
@@ -1994,9 +1994,14 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
in_plugin->name, in_plugin->long_name);
/* no emulators */
- if (!strncmp (in_plugin->long_name, "raw ", 4) ||
- !strncmp (in_plugin->long_name, "pcm ", 4) ||
- !strcmp (in_plugin->name, "audio_device") ||
+ if (in_plugin->long_name != NULL) {
+ if (!strncmp (in_plugin->long_name, "raw ", 4) ||
+ !strncmp (in_plugin->long_name, "pcm ", 4)
+ )
+ continue;
+ }
+
+ if (!strcmp (in_plugin->name, "audio_device") ||
!strncmp (in_plugin->name, "image", 5) ||
!strcmp (in_plugin->name, "mpegvideo") ||
!strcmp (in_plugin->name, "mjpeg") ||