summaryrefslogtreecommitdiff
path: root/libavcodec/eacmv.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-01-22 13:17:53 +0100
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-01-28 22:01:05 +0100
commita0eb8de5e01a6401c3b310b5221ab7c3bc485f12 (patch)
tree4ccc808ebe29dd5102e946195689d0acf0d44e4f /libavcodec/eacmv.c
parent0b378e8aa99e24f5d1b128abaaf1572542ce86f1 (diff)
Merge palette-only header with actual video frame.
This fixes the video frame pts (off by one for each MVIh) and makes the "key frames" decode stand-alone (MVIh contains only palette, such a palette-only frame being marked as key frame is not really correct). Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/eacmv.c')
-rw-r--r--libavcodec/eacmv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index 8a8d6a9cef..82ec9fc9fc 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -162,8 +162,11 @@ static int cmv_decode_frame(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) {
+ unsigned size = AV_RL32(buf + 4);
cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end);
- return buf_size;
+ if (size > buf_end - buf - EA_PREAMBLE_SIZE)
+ return -1;
+ buf += size;
}
if (av_image_check_size(s->width, s->height, 0, s->avctx))