Mercurial > mplayer.hg
changeset 33132:6ac1b560e209
Revise Convert24to32().
Make variables match txSample member types and rename tmpImage (which
is the original) orgImage.
author | ib |
---|---|
date | Tue, 05 Apr 2011 10:39:59 +0000 |
parents | aa753565a901 |
children | 41485430b18a |
files | gui/util/bitmap.c |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/util/bitmap.c Tue Apr 05 09:28:59 2011 +0000 +++ b/gui/util/bitmap.c Tue Apr 05 10:39:59 2011 +0000 @@ -121,17 +121,18 @@ static int Convert24to32(txSample *bf) { - unsigned char *tmpImage; - unsigned int i, c; + char *orgImage; + unsigned long i, c; if (bf->BPP == 24) { - tmpImage = bf->Image; + orgImage = bf->Image; + bf->BPP = 32; bf->ImageSize = bf->Width * bf->Height * 4; bf->Image = calloc(1, bf->ImageSize); if (!bf->Image) { - free(tmpImage); + free(orgImage); mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] not enough memory: %lu\n", bf->ImageSize); return 0; } @@ -139,9 +140,9 @@ mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] 32 bpp conversion size: %lu\n", bf->ImageSize); for (c = 0, i = 0; c < bf->ImageSize; c += 4, i += 3) - *(uint32_t *)&bf->Image[c] = AV_RB24(&tmpImage[i]); + *(uint32_t *)&bf->Image[c] = AV_RB24(&orgImage[i]); - free(tmpImage); + free(orgImage); } return 1;