Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
91e6074c
Kaydet (Commit)
91e6074c
authored
Nis 23, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoid integer overflow
Change-Id: Id429ad5ebb9bd1501292756db45d9fac76f26222
üst
211637d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
salbmp.cxx
vcl/quartz/salbmp.cxx
+23
-8
No files found.
vcl/quartz/salbmp.cxx
Dosyayı görüntüle @
91e6074c
...
@@ -17,6 +17,11 @@
...
@@ -17,6 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
*/
#include <sal/config.h>
#include <cstddef>
#include <limits>
#include "basebmp/scanlineformats.hxx"
#include "basebmp/scanlineformats.hxx"
#include "basebmp/color.hxx"
#include "basebmp/color.hxx"
...
@@ -296,21 +301,31 @@ bool QuartzSalBitmap::AllocateUserData()
...
@@ -296,21 +301,31 @@ bool QuartzSalBitmap::AllocateUserData()
}
}
}
}
try
bool
alloc
=
false
;
if
(
mnBytesPerRow
!=
0
&&
mnBytesPerRow
<=
std
::
numeric_limits
<
std
::
size_t
>::
max
()
/
mnHeight
)
{
{
if
(
mnBytesPerRow
)
try
{
maUserBuffer
.
reset
(
new
sal_uInt8
[
mnBytesPerRow
*
mnHeight
]
);
maUserBuffer
.
reset
(
new
sal_uInt8
[
mnBytesPerRow
*
mnHeight
]
);
#ifdef DBG_UTIL
alloc
=
true
;
for
(
size_t
i
=
0
;
i
<
mnBytesPerRow
*
mnHeight
;
i
++
)
}
maUserBuffer
.
get
()[
i
]
=
(
i
&
0xFF
);
catch
(
std
::
bad_alloc
&
)
{}
#endif
}
}
catch
(
const
std
::
bad_alloc
&
)
if
(
!
alloc
)
{
{
OSL_FAIL
(
"vcl::QuartzSalBitmap::AllocateUserData: bad alloc"
);
SAL_WARN
(
"vcl.quartz"
,
"bad alloc "
<<
mnBytesPerRow
<<
"x"
<<
mnHeight
);
maUserBuffer
.
reset
(
static_cast
<
sal_uInt8
*>
(
NULL
)
);
maUserBuffer
.
reset
(
static_cast
<
sal_uInt8
*>
(
NULL
)
);
mnBytesPerRow
=
0
;
mnBytesPerRow
=
0
;
}
}
#ifdef DBG_UTIL
else
{
for
(
size_t
i
=
0
;
i
<
mnBytesPerRow
*
mnHeight
;
i
++
)
maUserBuffer
.
get
()[
i
]
=
(
i
&
0xFF
);
}
#endif
return
maUserBuffer
.
get
()
!=
0
;
return
maUserBuffer
.
get
()
!=
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment