diff options
Diffstat (limited to 'contrib/ffmpeg/libavcodec/svq3.c')
-rw-r--r-- | contrib/ffmpeg/libavcodec/svq3.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/ffmpeg/libavcodec/svq3.c b/contrib/ffmpeg/libavcodec/svq3.c index edf3b6714..db601010b 100644 --- a/contrib/ffmpeg/libavcodec/svq3.c +++ b/contrib/ffmpeg/libavcodec/svq3.c @@ -285,8 +285,8 @@ static inline void svq3_mc_dir_part (MpegEncContext *s, emu = 1; } - mx = clip (mx, -16, (s->h_edge_pos - width + 15)); - my = clip (my, -16, (s->v_edge_pos - height + 15)); + mx = av_clip (mx, -16, (s->h_edge_pos - width + 15)); + my = av_clip (my, -16, (s->v_edge_pos - height + 15)); } /* form component predictions */ @@ -361,8 +361,8 @@ static inline int svq3_mc_dir (H264Context *h, int size, int mode, int dir, int } /* clip motion vector prediction to frame border */ - mx = clip (mx, extra_width - 6*x, h_edge_pos - 6*x); - my = clip (my, extra_width - 6*y, v_edge_pos - 6*y); + mx = av_clip (mx, extra_width - 6*x, h_edge_pos - 6*x); + my = av_clip (my, extra_width - 6*y, v_edge_pos - 6*y); /* get (optional) motion vector differential */ if (mode == PREDICT_MODE) { @@ -826,11 +826,11 @@ static int svq3_decode_frame (AVCodecContext *avctx, } /* if a match was found, parse the extra data */ - if (!memcmp (extradata, "SEQH", 4)) { + if (extradata && !memcmp (extradata, "SEQH", 4)) { GetBitContext gb; - size = BE_32(&extradata[4]); + size = AV_RB32(&extradata[4]); init_get_bits (&gb, extradata + 8, size*8); /* 'frame size code' and optional 'width, height' */ @@ -910,7 +910,8 @@ static int svq3_decode_frame (AVCodecContext *avctx, s->next_p_frame_damaged = 0; } - frame_start (h); + if (frame_start (h) < 0) + return -1; if (s->pict_type == B_TYPE) { h->frame_num_offset = (h->slice_num - h->prev_frame_num); |