From 39a7a5b8ab12bc75306f52e671dfb1497771553b Mon Sep 17 00:00:00 2001 From: Aaron Colwell Date: Mon, 28 Nov 2011 07:23:03 -0800 Subject: pthread: don't increment index on zero-sized packets. The next call to decode() will update from an invalid index, which will either lead to a memcpy() where dest==src (2 threads), or lead to a crash (>2 threads). Signed-off-by: Ronald S. Bultje --- libavcodec/pthread.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 21e32b59ea..1364f5722d 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -491,6 +491,7 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt) } fctx->prev_thread = p; + fctx->next_decoding++; return 0; } @@ -513,8 +514,6 @@ int ff_thread_decode_frame(AVCodecContext *avctx, err = submit_packet(p, avpkt); if (err) return err; - fctx->next_decoding++; - /* * If we're still receiving the initial packets, don't return a frame. */ -- cgit v1.2.3 From 464ccb01447b91717cf580b870e636514701ce4f Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Tue, 29 Nov 2011 23:13:35 +0530 Subject: indeo3: check per-plane data buffer against input buffer bounds. Fixes : http://bugzilla.libav.org/show_bug.cgi?id=102 Signed-off-by: Alex Converse --- libavcodec/indeo3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavcodec') diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 4f3cb36606..46efbd86d2 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -804,8 +804,10 @@ static int decode_plane(Indeo3DecodeContext *ctx, AVCodecContext *avctx, num_vectors = bytestream_get_le32(&data); ctx->mc_vectors = num_vectors ? data : 0; + if (num_vectors * 2 >= data_size) + return AVERROR_INVALIDDATA; /* init the bitreader */ - init_get_bits(&ctx->gb, &data[num_vectors * 2], data_size << 3); + init_get_bits(&ctx->gb, &data[num_vectors * 2], (data_size - num_vectors * 2) << 3); ctx->skip_bits = 0; ctx->need_resync = 0; -- cgit v1.2.3