Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/orc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2011-10-03 03:25:22 +0400
committerDavid Schleef <ds@schleef.org>2011-10-03 03:25:22 +0400
commit5cda9c082a1b468657f52399c00d41b3ec362b42 (patch)
tree8d43082f6e9e9f4c662c4701a9ee108bfed734b2
parentf088b225d0f1c17f3fb7daff9af52803db52f65a (diff)
parse: check for empty source file
-rw-r--r--orc/orcparse.c2
-rw-r--r--tools/orcc.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/orc/orcparse.c b/orc/orcparse.c
index 00056c3..ea17c13 100644
--- a/orc/orcparse.c
+++ b/orc/orcparse.c
@@ -324,7 +324,7 @@ orc_parse_full (const char *code, OrcProgram ***programs, char **log)
} else {
free (parser->log);
}
- if (parser->programs[0]) {
+ if (parser->programs && parser->programs[0]) {
parser->programs[0]->init_function = init_function;
} else {
free (init_function);
diff --git a/tools/orcc.c b/tools/orcc.c
index 35dab6b..9766d02 100644
--- a/tools/orcc.c
+++ b/tools/orcc.c
@@ -227,6 +227,11 @@ main (int argc, char *argv[])
n_programs = n;
printf("%s", log);
+ if (programs == NULL) {
+ printf("no programs\n");
+ exit(1);
+ }
+
if (init_function == NULL) {
init_function = orc_parse_get_init_function (programs[0]);
}