From f6774f905fb3cfdc319523ac640be30b14c1bc55 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 31 Mar 2014 17:46:29 +0000 Subject: mpegvideo: operate with pointers to AVFrames instead of whole structs The most interesting parts are initialization in ff_MPV_common_init() and uninitialization in ff_MPV_common_end(). ff_mpeg_unref_picture and ff_thread_release_buffer have additional NULL checks for Picture.f, because these functions can be called on uninitialized or partially initialized Pictures. NULL pointer checks are added to ff_thread_release_buffer() stub function. Signed-off-by: Vittorio Giovara --- libavcodec/msmpeg4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavcodec/msmpeg4.c') diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index c76a14b6be..f0eaa9bb5b 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -277,10 +277,10 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, }else{ if(n<4){ wrap= s->linesize; - dest= s->current_picture.f.data[0] + (((n >> 1) + 2*s->mb_y) * 8* wrap ) + ((n & 1) + 2*s->mb_x) * 8; + dest= s->current_picture.f->data[0] + (((n >> 1) + 2*s->mb_y) * 8* wrap ) + ((n & 1) + 2*s->mb_x) * 8; }else{ wrap= s->uvlinesize; - dest= s->current_picture.f.data[n - 3] + (s->mb_y * 8 * wrap) + s->mb_x * 8; + dest= s->current_picture.f->data[n - 3] + (s->mb_y * 8 * wrap) + s->mb_x * 8; } if(s->mb_x==0) a= (1024 + (scale>>1))/scale; else a= get_dc(dest-8, wrap, scale*8); -- cgit v1.2.3