[gegl] ff-load: avoid crash on invalid path
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] ff-load: avoid crash on invalid path
- Date: Sun, 12 Mar 2017 21:40:02 +0000 (UTC)
commit 766c245ea84024f8ed20f1b61bf4d351e91fdf82
Author: Øyvind Kolås <pippin gimp org>
Date: Sun Mar 12 22:14:16 2017 +0100
ff-load: avoid crash on invalid path
operations/external/ff-load.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/operations/external/ff-load.c b/operations/external/ff-load.c
index 230163a..e7fd140 100644
--- a/operations/external/ff-load.c
+++ b/operations/external/ff-load.c
@@ -415,10 +415,11 @@ prepare (GeglOperation *operation)
gegl_operation_set_format (operation, "output", babl_format ("R'G'B' u8"));
- if (!p->loadedfilename ||
+ if (o->path &&
+ (!p->loadedfilename ||
strcmp (p->loadedfilename, o->path) ||
p->prevframe > o->frame /* a bit heavy handed, but improves consistency */
- )
+ ))
{
gint i;
gchar *dereferenced_path;
@@ -426,6 +427,8 @@ prepare (GeglOperation *operation)
ff_cleanup (o);
dereferenced_path = realpath (o->path, NULL);
+ if (!dereferenced_path)
+ return;
err = avformat_open_input(&p->video_fcontext, dereferenced_path, NULL, 0);
free (dereferenced_path);
if (err < 0)
@@ -680,7 +683,7 @@ process (GeglOperation *operation,
Priv *p = (Priv*)o->user_data;
{
- if (p->video_fcontext && !decode_frame (operation, o->frame))
+ if (o->path && p->video_fcontext && !decode_frame (operation, o->frame))
{
long sample_start = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]