* src/media/media-internal.c (media_internal_analyse_stream): Make
sure that only if conversion to external format is successful we
try to open the file otherwise return as if file open failed.
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
switch (media_stream_kind(ms)) {
case MKIND_FILE: {
mkind_file_properties *mkfp = NULL;
- const char *file;
+ const char *file = NULL;
int file_len = 0;
/* open the file */
mkfp = media_stream_kind_properties(ms).fprops;
TO_EXTERNAL_FORMAT(LISP_STRING, mkfp->filename,
ALLOCA, (file, file_len), Qnil);
- if ((fd = open(file, O_RDONLY, 0)) < 0) {
+ if (file == NULL || (fd = open(file, O_RDONLY, 0)) < 0) {
xfree(data);
return;
}