archrelease: copy trunk to extra-x86_64
[arch-packages.git] / lensfun / trunk / lensfun-segfault.patch
blobdf47f9aa4d6b370c856b68dccd78571f9e82b3dd
1 diff --git a/libs/lensfun/lens.cpp b/libs/lensfun/lens.cpp
2 index 52b76658..b8430609 100644
3 --- a/libs/lensfun/lens.cpp
4 +++ b/libs/lensfun/lens.cpp
5 @@ -66,9 +66,10 @@ lfLens::lfLens (const lfLens &other)
6 Mounts = NULL;
7 MountNames.clear();
8 const char* const* otherMounts = other.GetMountNames();
9 - for (int i = 0; otherMounts[i]; i++)
10 - AddMount(otherMounts[i]);
12 + if (otherMounts) {
13 + for (int i = 0; otherMounts[i]; i++)
14 + AddMount(otherMounts[i]);
15 + }
16 for (auto *calibset : other.Calibrations)
17 Calibrations.push_back(new lfLensCalibrationSet(*calibset));
19 @@ -96,9 +97,10 @@ lfLens &lfLens::operator = (const lfLens &other)
20 Mounts = NULL;
21 MountNames.clear();
22 const char* const* otherMounts = other.GetMountNames();
23 - for (int i = 0; otherMounts[i]; i++)
24 - AddMount(otherMounts[i]);
26 + if (otherMounts) {
27 + for (int i = 0; otherMounts[i]; i++)
28 + AddMount(otherMounts[i]);
29 + }
30 for (auto *calibset : Calibrations)
31 delete calibset;
32 Calibrations.clear();
33 diff --git a/libs/lensfun/mount.cpp b/libs/lensfun/mount.cpp
34 index bd875baa..86f667cb 100644
35 --- a/libs/lensfun/mount.cpp
36 +++ b/libs/lensfun/mount.cpp
37 @@ -28,8 +28,10 @@ lfMount::lfMount (const lfMount &other)
39 MountCompat.clear();
40 const char* const* otherMounts = other.GetCompats();
41 - for (int i = 0; otherMounts[i]; i++)
42 - AddCompat(otherMounts[i]);
43 + if (otherMounts) {
44 + for (int i = 0; otherMounts[i]; i++)
45 + AddCompat(otherMounts[i]);
46 + }
49 lfMount &lfMount::operator = (const lfMount &other)
50 @@ -40,9 +42,10 @@ lfMount &lfMount::operator = (const lfMount &other)
52 MountCompat.clear();
53 const char* const* otherMounts = other.GetCompats();
54 - for (int i = 0; otherMounts[i]; i++)
55 - AddCompat(otherMounts[i]);
57 + if (otherMounts) {
58 + for (int i = 0; otherMounts[i]; i++)
59 + AddCompat(otherMounts[i]);
60 + }
61 return *this;