summaryrefslogtreecommitdiff
path: root/libavcodec/eamad.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-14 04:27:35 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-14 04:27:35 +0100
commit685f50b374411fce2790d710f75c15410cb3cee7 (patch)
tree0ca64a6f8dd224fb7731ae05a2eb09440684ab3d /libavcodec/eamad.c
parent6086a4d74d09e2df57f9b84006c877b829707d40 (diff)
parent0cb3cab3431276c9339df91bfdbf30510d784a6c (diff)
downloadffmpeg-685f50b374411fce2790d710f75c15410cb3cee7.tar.gz
Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9: eamad: allocate a dummy reference frame when the real one is missing libmp3lame: use the correct remaining buffer size when flushing png: use av_mallocz_array() for the zlib zalloc function wmaprodec: require block_align to be set. ffv1: fix calculating slice dimensions for version 2 xxan: fix invalid memory access in xan_decode_frame_type0() wmadec: require block_align to be set. ivi_common: do not call MC for intra frames when dc_transform is unset Conflicts: libavcodec/ffv1dec.c libavcodec/ivi_common.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/eamad.c')
-rw-r--r--libavcodec/eamad.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 2f9559fe8e..e71bf9adb3 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -276,6 +276,21 @@ static int decode_frame(AVCodecContext *avctx,
}
}
+ if (inter && !s->last_frame.data[0]) {
+ int ret;
+ av_log(avctx, AV_LOG_WARNING, "Missing reference frame.\n");
+ s->last_frame.reference = 1;
+ ret = ff_get_buffer(avctx, &s->last_frame);
+ if (ret < 0)
+ return ret;
+ memset(s->last_frame.data[0], 0, s->last_frame.height *
+ s->last_frame.linesize[0]);
+ memset(s->last_frame.data[1], 0x80, s->last_frame.height / 2 *
+ s->last_frame.linesize[1]);
+ memset(s->last_frame.data[2], 0x80, s->last_frame.height / 2 *
+ s->last_frame.linesize[2]);
+ }
+
av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size,
buf_end - buf);
if (!s->bitstream_buf)