Merge pull request #26911 from KidRigger/pr-fix

Fixes segfault on opening incompatible files in GDNative videodecoder.
This commit is contained in:
Rémi Verschelde 2019-03-11 12:46:35 +01:00 committed by GitHub
commit 0deb3921e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,6 +117,7 @@ bool VideoStreamPlaybackGDNative::open_file(const String &p_file) {
file = FileAccess::open(p_file, FileAccess::READ);
bool file_opened = interface->open_file(data_struct, file);
if (file_opened) {
num_channels = interface->get_channels(data_struct);
mix_rate = interface->get_mix_rate(data_struct);
@ -129,6 +130,7 @@ bool VideoStreamPlaybackGDNative::open_file(const String &p_file) {
samples_decoded = 0;
texture->create((int)texture_size.width, (int)texture_size.height, Image::FORMAT_RGBA8, Texture::FLAG_FILTER | Texture::FLAG_VIDEO_SURFACE);
}
return file_opened;
}