Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2012-03-02 02:07:22 +0400
committerReinhard Tartler <siretart@tauware.de>2012-04-01 20:33:27 +0400
commitb56b7b9081d5b9048732c0db171c7b6af9831bad (patch)
tree440c22c9682bfe214af7ecddeaf4ef104069d3e7 /libavcodec
parentbd0d32d13181c452906011e33000fc4328771005 (diff)
rv10/20: Fix a buffer overread caused by losing track of the remaining buffer size.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org (cherry picked from commit 2f6528537fdd88820f3a4683d5e595d7b3a62689) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/rv10.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 223500c356..3ac0378d7d 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -653,8 +653,12 @@ static int rv10_decode_frame(AVCodecContext *avctx,
if(!avctx->slice_count){
slice_count = (*buf++) + 1;
+ buf_size--;
slices_hdr = buf + 4;
buf += 8 * slice_count;
+ buf_size -= 8 * slice_count;
+ if (buf_size <= 0)
+ return AVERROR_INVALIDDATA;
}else
slice_count = avctx->slice_count;
@@ -693,7 +697,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
s->current_picture_ptr= NULL; //so we can detect if frame_end wasnt called (find some nicer solution...)
}
- return buf_size;
+ return avpkt->size;
}
AVCodec ff_rv10_decoder = {