diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-02 11:04:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-02 13:27:52 +0200 |
commit | 5c0cee64b9430da404fa52988871fae6a5dd9f41 (patch) | |
tree | 6a6c5a36730d5815986c4a00459db5f4a12f9f03 /vcl/headless | |
parent | 70c477e80bb0b345f64c54cae681f7eba12a7968 (diff) |
no need to assign a nullptr after a bad_alloc
since if the allocation failed, the assignment would never happen
Also use early exit to simplify the code in X11SalBitmap::ImplCreateDIB
Change-Id: I73301bfad6492c2b42c08744c24cfb78237983f0
Reviewed-on: https://gerrit.libreoffice.org/38346
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svpbmp.cxx | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx index 5be976fc9e74..15c6fc9c1022 100644 --- a/vcl/headless/svpbmp.cxx +++ b/vcl/headless/svpbmp.cxx @@ -64,11 +64,8 @@ BitmapBuffer* ImplCreateDIB( } catch (const std::bad_alloc&) { - pDIB = nullptr; - } - - if(!pDIB) return nullptr; + } const sal_uInt16 nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0; |