summaryrefslogtreecommitdiff
path: root/libavcodec/indeo4.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-14 12:34:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-14 12:38:54 +0200
commit54623619373d316136d184153d0d7387acef6426 (patch)
treea2e0cd94f3a860e24a5a2afab742d5777afe0d42 /libavcodec/indeo4.c
parentac20ba35e37dac843c9692a02a63e6a6e3bcce36 (diff)
parent8435bca087c0e79385763c51de009fd89390b6a5 (diff)
Merge commit '8435bca087c0e79385763c51de009fd89390b6a5'
* commit '8435bca087c0e79385763c51de009fd89390b6a5': indeo4: Do not access missing reference MV Conflicts: libavcodec/indeo4.c See: 5216245a, aae44fb4 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/indeo4.c')
-rw-r--r--libavcodec/indeo4.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index 873b828384..dafba38f4b 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -510,8 +510,11 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
}
}
} else {
- if (band->inherit_mv && ref_mb) {
- mb->type = ref_mb->type; /* copy mb_type from corresponding reference mb */
+ if (band->inherit_mv) {
+ /* copy mb_type from corresponding reference mb */
+ if (!ref_mb)
+ return AVERROR_INVALIDDATA;
+ mb->type = ref_mb->type;
} else if (ctx->frame_type == FRAMETYPE_INTRA ||
ctx->frame_type == FRAMETYPE_INTRA1) {
mb->type = 0; /* mb_type is always INTRA for intra-frames */
@@ -534,15 +537,16 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
if (!mb->type) {
mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */
} else {
- if (band->inherit_mv && ref_mb) {
- /* motion vector inheritance */
- if (mv_scale) {
- mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
- mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
- } else {
- mb->mv_x = ref_mb->mv_x;
- mb->mv_y = ref_mb->mv_y;
- }
+ if (band->inherit_mv) {
+ if (ref_mb)
+ /* motion vector inheritance */
+ if (mv_scale) {
+ mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
+ mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
+ } else {
+ mb->mv_x = ref_mb->mv_x;
+ mb->mv_y = ref_mb->mv_y;
+ }
} else {
/* decode motion vector deltas */
mv_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,