Mercurial > libavcodec.hg
comparison utils.c @ 2426:1ee03f2a6cd5 libavcodec
av_malloc vs av_mallocz patch by (Kurosu <kurosu inforezo org>)
author | michael |
---|---|
date | Wed, 12 Jan 2005 18:25:48 +0000 |
parents | 87b7fbed8609 |
children | f67b63ed036d |
comparison
equal
deleted
inserted
replaced
2425:d0bcc85d3856 | 2426:1ee03f2a6cd5 |
---|---|
312 const int v_shift= i==0 ? 0 : v_chroma_shift; | 312 const int v_shift= i==0 ? 0 : v_chroma_shift; |
313 | 313 |
314 //FIXME next ensures that linesize= 2^x uvlinesize, thats needed because some MC code assumes it | 314 //FIXME next ensures that linesize= 2^x uvlinesize, thats needed because some MC code assumes it |
315 buf->linesize[i]= ALIGN(pixel_size*w>>h_shift, STRIDE_ALIGN<<(h_chroma_shift-h_shift)); | 315 buf->linesize[i]= ALIGN(pixel_size*w>>h_shift, STRIDE_ALIGN<<(h_chroma_shift-h_shift)); |
316 | 316 |
317 buf->base[i]= av_mallocz((buf->linesize[i]*h>>v_shift)+16); //FIXME 16 | 317 buf->base[i]= av_malloc((buf->linesize[i]*h>>v_shift)+16); //FIXME 16 |
318 if(buf->base[i]==NULL) return -1; | 318 if(buf->base[i]==NULL) return -1; |
319 memset(buf->base[i], 128, buf->linesize[i]*h>>v_shift); | 319 memset(buf->base[i], 128, buf->linesize[i]*h>>v_shift); |
320 | 320 |
321 if(s->flags&CODEC_FLAG_EMU_EDGE) | 321 if(s->flags&CODEC_FLAG_EMU_EDGE) |
322 buf->data[i] = buf->base[i]; | 322 buf->data[i] = buf->base[i]; |