aboutsummaryrefslogtreecommitdiff
path: root/gst-libs/ext/libav/libavcodec/vc1dec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/ext/libav/libavcodec/vc1dec.c')
-rw-r--r--gst-libs/ext/libav/libavcodec/vc1dec.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gst-libs/ext/libav/libavcodec/vc1dec.c b/gst-libs/ext/libav/libavcodec/vc1dec.c
index c29f91c..bafd6a2 100644
--- a/gst-libs/ext/libav/libavcodec/vc1dec.c
+++ b/gst-libs/ext/libav/libavcodec/vc1dec.c
@@ -394,6 +394,11 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
}
}
+ if (!srcY || !srcU) {
+ av_log(v->s.avctx, AV_LOG_ERROR, "Referenced frame missing.\n");
+ return;
+ }
+
src_x = s->mb_x * 16 + (mx >> 2);
src_y = s->mb_y * 16 + (my >> 2);
uvsrc_x = s->mb_x * 8 + (uvmx >> 2);
@@ -569,6 +574,11 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir)
} else
srcY = s->next_picture.f.data[0];
+ if (!srcY) {
+ av_log(v->s.avctx, AV_LOG_ERROR, "Referenced frame missing.\n");
+ return;
+ }
+
if (v->field_mode) {
if (v->cur_field_type != v->ref_field_type[dir])
my = my - 2 + 4 * v->cur_field_type;
@@ -856,6 +866,11 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
srcV = s->next_picture.f.data[2] + uvsrc_y * s->uvlinesize + uvsrc_x;
}
+ if (!srcU) {
+ av_log(v->s.avctx, AV_LOG_ERROR, "Referenced frame missing.\n");
+ return;
+ }
+
if (v->field_mode) {
if (chroma_ref_type) {
srcU += s->current_picture_ptr->f.linesize[1];
@@ -5579,6 +5594,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
v->mv_f[1] = tmp[1];
}
mb_height = s->mb_height >> v->field_mode;
+
+ if (!mb_height) {
+ av_log(v->s.avctx, AV_LOG_ERROR, "Invalid mb_height.\n");
+ goto err;
+ }
+
for (i = 0; i <= n_slices; i++) {
if (i > 0 && slices[i - 1].mby_start >= mb_height) {
if (v->field_mode <= 0) {