summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/mp_image.h
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-26 11:51:19 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-26 11:51:19 +0000
commitafc5a627d85cec556e7fca13fc5a03e5c4452850 (patch)
treee865cca32e1c14512cccb11f4f15f90bbd31ff32 /libmpcodecs/mp_image.h
parentbd06a94738d902bbac42c4573ba8640463423b8e (diff)
downloadmpv-afc5a627d85cec556e7fca13fc5a03e5c4452850.tar.bz2
mpv-afc5a627d85cec556e7fca13fc5a03e5c4452850.tar.xz
Support mp_image with allocated palette.
Fixes playback and a memory leak for FFmpeg codecs which use reget_buffer with paletted data, e.g. cdgraphics. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30116 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/mp_image.h')
-rw-r--r--libmpcodecs/mp_image.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmpcodecs/mp_image.h b/libmpcodecs/mp_image.h
index ddf52c71c5..9e02571380 100644
--- a/libmpcodecs/mp_image.h
+++ b/libmpcodecs/mp_image.h
@@ -38,7 +38,7 @@
#define MP_IMGFLAG_YUV 0x200
// set if it's swapped (BGR or YVU) plane/byteorder
#define MP_IMGFLAG_SWAPPED 0x400
-// using palette for RGB data
+// set if you want memory for palette allocated and managed by vf_get_image etc.
#define MP_IMGFLAG_RGB_PALETTE 0x800
#define MP_IMGFLAGMASK_COLORS 0xF00
@@ -223,6 +223,8 @@ static inline void free_mp_image(mp_image_t* mpi){
if(mpi->flags&MP_IMGFLAG_ALLOCATED){
/* becouse we allocate the whole image in once */
if(mpi->planes[0]) free(mpi->planes[0]);
+ if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
+ free(mpi->planes[1]);
}
free(mpi);
}