diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-08-04 12:04:10 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-08-29 17:40:28 +0200 |
commit | f71aae75017308545d0f835de6a5e39603d17002 (patch) | |
tree | 24bf333c937cfb4f755562d7f7df71012284b2d6 /avmedia | |
parent | 9991b50ccc6ef3d26c28859b4a31504bd5001368 (diff) |
It seems better if the caller allocates the memory for the RGBA buffer.
For example it allows to use std::vector<> and call the method
Change-Id: Id4b8e33838d358dd242d0176e42558505fa8d4a3
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/opengl/oglplayer.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/avmedia/source/opengl/oglplayer.cxx b/avmedia/source/opengl/oglplayer.cxx index 0b7e2424abc2..917ab2d12c6a 100644 --- a/avmedia/source/opengl/oglplayer.cxx +++ b/avmedia/source/opengl/oglplayer.cxx @@ -103,7 +103,8 @@ bool OGLPlayer::create( const OUString& rURL ) } BitmapEx aBitmapEx = aGraphic.GetBitmapEx(); aBitmapEx.Mirror(BMP_MIRROR_VERT); - rFile.buffer = (char*)OpenGLHelper::ConvertBitmapExToRGBABuffer(aBitmapEx); + rFile.buffer = new char[4 * aBitmapEx.GetSizePixel().Width() * aBitmapEx.GetSizePixel().Height()]; + OpenGLHelper::ConvertBitmapExToRGBABuffer(aBitmapEx, reinterpret_cast<sal_uInt8*>(rFile.buffer)); rFile.imagewidth = aBitmapEx.GetSizePixel().Width(); rFile.imageheight = aBitmapEx.GetSizePixel().Height(); } |