# HG changeset patch # User lorenm # Date 1105174578 0 # Node ID 06b7d678b5826892a9397fec4b8695519ec7f686 # Parent db2cf6005d19b13828cf1e8ea61157791fe8b4a8 10l: scratchpad could be allocated before its size was known. diff -r db2cf6005d19 -r 06b7d678b582 h264.c --- a/h264.c Fri Jan 07 05:56:07 2005 +0000 +++ b/h264.c Sat Jan 08 08:56:18 2005 +0000 @@ -2540,8 +2540,6 @@ } } - CHECKED_ALLOCZ(s->obmc_scratchpad, 16*s->linesize + 2*8*s->uvlinesize); - return 0; fail: free_tables(h); @@ -2613,6 +2611,11 @@ h->block_offset[20+i]= 4*((scan8[i] - scan8[0])&7) + 4*s->uvlinesize*((scan8[i] - scan8[0])>>3); } + /* can't be in alloc_tables because linesize isn't known there. + * FIXME: redo bipred weight to not require extra buffer? */ + if(!s->obmc_scratchpad) + s->obmc_scratchpad = av_malloc(16*s->linesize + 2*8*s->uvlinesize); + // s->decode= (s->flags&CODEC_FLAG_PSNR) || !s->encoding || s->current_picture.reference /*|| h->contains_intra*/ || 1; }