summaryrefslogtreecommitdiff
path: root/libavcodec/error_resilience.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-01-08 18:24:35 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-01-08 18:24:35 +0000
commit967be700506dce69b69aaa5c479b51db45a665f2 (patch)
tree2bd76c824fd58a0e05d0981b5a664a55bd85da21 /libavcodec/error_resilience.c
parent64cba7481b9bf2907574afbe6eca2f8ced8c2ecb (diff)
memleak fix
Originally committed as revision 2676 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/error_resilience.c')
-rw-r--r--libavcodec/error_resilience.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index ee3b2816af..db0c1f9f60 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -673,11 +673,16 @@ void ff_er_frame_end(MpegEncContext *s){
if(s->current_picture.motion_val[0] == NULL){
int size = (2 * s->mb_width + 2) * (2 * s->mb_height + 2);
+ Picture *pic= s->current_picture_ptr;
av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
-
- s->current_picture.motion_val[0]= av_mallocz(size * 2 * sizeof(int16_t)); //FIXME
- s->current_picture.motion_val[1]= av_mallocz(size * 2 * sizeof(int16_t));
+
+ for(i=0; i<2; i++){
+ pic->motion_val_base[i]= av_mallocz((size+1) * 2 * sizeof(uint16_t)); //FIXME size
+ pic->motion_val[i]= pic->motion_val_base[i]+1;
+ }
+ pic->motion_subsample_log2= 3;
+ s->current_picture= *s->current_picture_ptr;
}
if(s->avctx->debug&FF_DEBUG_ER){