# HG changeset patch # User ib # Date 1301999999 0 # Node ID 6ac1b560e2094f5f4e99a8f19f2da76118694466 # Parent aa753565a901ed0dd760b8ac40717cb8e8a770fa Revise Convert24to32(). Make variables match txSample member types and rename tmpImage (which is the original) orgImage. diff -r aa753565a901 -r 6ac1b560e209 gui/util/bitmap.c --- 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;