Mercurial > libavcodec.hg
changeset 8962:69747b732498 libavcodec
Replace sizeof(short) by the more robust sizeof(*s->pblocks[i]) in memset and
memcpy calls. s->pblocks is the element actually being handled.
author | diego |
---|---|
date | Tue, 17 Feb 2009 23:51:28 +0000 |
parents | 22227c45a1fd |
children | 14c71c1f46b0 |
files | mpegvideo_xvmc.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mpegvideo_xvmc.c Tue Feb 17 23:36:28 2009 +0000 +++ b/mpegvideo_xvmc.c Tue Feb 17 23:51:28 2009 +0000 @@ -281,7 +281,7 @@ if (s->flags & CODEC_FLAG_GRAY) { if (s->mb_intra) { // intra frames are always full chroma blocks for (i = 4; i < blocks_per_mb; i++) { - memset(s->pblocks[i], 0, sizeof(short)*64); // so we need to clear them + memset(s->pblocks[i], 0, sizeof(*s->pblocks[i])*64); // so we need to clear them if (!render->unsigned_intra) s->pblocks[i][0] = 1 << 10; } @@ -309,7 +309,7 @@ // copy blocks only if the codec doesn't support pblocks reordering if (s->avctx->xvmc_acceleration == 1) { memcpy(&render->data_blocks[render->next_free_data_block_num*64], - s->pblocks[i], sizeof(short)*64); + s->pblocks[i], sizeof(*s->pblocks[i])*64); } render->next_free_data_block_num++; }