aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2005-01-08 08:56:18 +0000
committerLoren Merritt <lorenm@u.washington.edu>2005-01-08 08:56:18 +0000
commit934b0821dbb8fb33b2736fe4aab09fc2b6cc8ccc (patch)
treec7826e601211d998c3afe253ebcf2544d1ac76b3
parent9f2d1b4ff5b2c3a3da16752d99c778f2e954c92d (diff)
downloadffmpeg-934b0821dbb8fb33b2736fe4aab09fc2b6cc8ccc.tar.gz
10l: scratchpad could be allocated before its size was known.
Originally committed as revision 3812 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/h264.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 421f9c0f59..c1f354e0db 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2540,8 +2540,6 @@ static int alloc_tables(H264Context *h){
}
}
- CHECKED_ALLOCZ(s->obmc_scratchpad, 16*s->linesize + 2*8*s->uvlinesize);
-
return 0;
fail:
free_tables(h);
@@ -2613,6 +2611,11 @@ static void frame_start(H264Context *h){
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;
}