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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Müller <nexyon@gmail.com>2021-09-24 00:27:49 +0300
committerJörg Müller <nexyon@gmail.com>2021-09-24 00:27:49 +0300
commitf7608276e35d03d5ad2d38f2189c6d6f5279c432 (patch)
tree056b271237283878d04f19ccb75f74593cf0d7d9
parent61f3d4eb7c7db711f9339d05e68b8f9eac3ce167 (diff)
Audaspace: port bugfix from upstream.
Fixes T91615: Instant crash when dragging video file into video editor sequencer
-rw-r--r--extern/audaspace/bindings/C/AUD_Sound.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/extern/audaspace/bindings/C/AUD_Sound.cpp b/extern/audaspace/bindings/C/AUD_Sound.cpp
index aa246b9a047..8a3c9d1bbc9 100644
--- a/extern/audaspace/bindings/C/AUD_Sound.cpp
+++ b/extern/audaspace/bindings/C/AUD_Sound.cpp
@@ -102,26 +102,30 @@ AUD_API int AUD_Sound_getFileStreams(AUD_Sound* sound, AUD_StreamInfo **stream_i
if(file)
{
- auto streams = file->queryStreams();
+ try
+ {
+ auto streams = file->queryStreams();
- size_t size = sizeof(AUD_StreamInfo) * streams.size();
+ size_t size = sizeof(AUD_StreamInfo) * streams.size();
- if(!size)
- {
- *stream_infos = nullptr;
- return 0;
- }
+ if(!size)
+ {
+ *stream_infos = nullptr;
+ return 0;
+ }
- *stream_infos = reinterpret_cast<AUD_StreamInfo*>(std::malloc(size));
- std::memcpy(*stream_infos, streams.data(), size);
+ *stream_infos = reinterpret_cast<AUD_StreamInfo*>(std::malloc(size));
+ std::memcpy(*stream_infos, streams.data(), size);
- return streams.size();
- }
- else
- {
- *stream_infos = nullptr;
- return 0;
+ return streams.size();
+ }
+ catch(Exception&)
+ {
+ }
}
+
+ *stream_infos = nullptr;
+ return 0;
}
AUD_API sample_t* AUD_Sound_data(AUD_Sound* sound, int* length, AUD_Specs* specs)