Browse Source

Fixed crash on loading GDNative videos.

Fixed issue with loading a resource supported by the gdnative videodecoders
that does not exist.
Anish 6 years ago
parent
commit
978c2a604a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      modules/gdnative/videodecoder/video_stream_gdnative.cpp

+ 1 - 1
modules/gdnative/videodecoder/video_stream_gdnative.cpp

@@ -355,9 +355,9 @@ RES ResourceFormatLoaderVideoStreamGDNative::load(const String &p_path, const St
 		if (r_error) {
 		if (r_error) {
 			*r_error = ERR_CANT_OPEN;
 			*r_error = ERR_CANT_OPEN;
 		}
 		}
-		memdelete(f);
 		return RES();
 		return RES();
 	}
 	}
+	memdelete(f);
 	VideoStreamGDNative *stream = memnew(VideoStreamGDNative);
 	VideoStreamGDNative *stream = memnew(VideoStreamGDNative);
 	stream->set_file(p_path);
 	stream->set_file(p_path);
 	Ref<VideoStreamGDNative> ogv_stream = Ref<VideoStreamGDNative>(stream);
 	Ref<VideoStreamGDNative> ogv_stream = Ref<VideoStreamGDNative>(stream);