1
From b4a1bf0bbf53cc6a736a608732b2ac1de5c2447b Mon Sep 17 00:00:00 2001
2
From: Laurent Aimar <fenrir@videolan.org>
3
Date: Sat, 17 Sep 2011 16:56:30 +0200
4
Subject: [PATCH 66/70] rv34: Fix potential overreads
6
Content-Type: text/plain; charset=UTF-8
7
Content-Transfer-Encoding: 8bit
9
Signed-off-by: Martin Storsjö <martin@martin.st>
10
(cherry picked from commit b4ed3d78cb6c41c9d3ee5918c326ab925edd6a89)
12
Signed-off-by: Anton Khirnov <anton@khirnov.net>
14
libavcodec/rv34.c | 5 +++--
15
1 files changed, 3 insertions(+), 2 deletions(-)
17
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
18
index 2383903..87fca5c 100644
19
--- a/libavcodec/rv34.c
20
+++ b/libavcodec/rv34.c
21
@@ -1436,6 +1436,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
22
slice_count = (*buf++) + 1;
24
buf += 8 * slice_count;
25
+ buf_size -= 1 + 8 * slice_count;
27
slice_count = avctx->slice_count;
29
@@ -1454,7 +1455,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
30
if( (avctx->skip_frame >= AVDISCARD_NONREF && si.type==AV_PICTURE_TYPE_B)
31
|| (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=AV_PICTURE_TYPE_I)
32
|| avctx->skip_frame >= AVDISCARD_ALL)
36
for(i=0; i<slice_count; i++){
37
int offset= get_slice_offset(avctx, slices_hdr, i);
38
@@ -1503,7 +1504,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
40
s->current_picture_ptr= NULL; //so we can detect if frame_end wasnt called (find some nicer solution...)
46
av_cold int ff_rv34_decode_end(AVCodecContext *avctx)