~ubuntu-branches/ubuntu/raring/libav/raring-security

« back to all changes in this revision

Viewing changes to debian/patches/post-0.7.1/0066-rv34-Fix-potential-overreads.patch

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2011-09-28 09:18:34 UTC
  • mfrom: (1.3.7 sid)
  • Revision ID: package-import@ubuntu.com-20110928091834-w415mnuh06h4zpvc
Tags: 4:0.7.1-7ubuntu2
Revert "Convert package to include multiarch support."

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
MIME-Version: 1.0
 
6
Content-Type: text/plain; charset=UTF-8
 
7
Content-Transfer-Encoding: 8bit
 
8
 
 
9
Signed-off-by: Martin Storsjö <martin@martin.st>
 
10
(cherry picked from commit b4ed3d78cb6c41c9d3ee5918c326ab925edd6a89)
 
11
 
 
12
Signed-off-by: Anton Khirnov <anton@khirnov.net>
 
13
---
 
14
 libavcodec/rv34.c |    5 +++--
 
15
 1 files changed, 3 insertions(+), 2 deletions(-)
 
16
 
 
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;
 
23
         slices_hdr = buf + 4;
 
24
         buf += 8 * slice_count;
 
25
+        buf_size -= 1 + 8 * slice_count;
 
26
     }else
 
27
         slice_count = avctx->slice_count;
 
28
 
 
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)
 
33
-        return buf_size;
 
34
+        return avpkt->size;
 
35
 
 
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,
 
39
         }
 
40
         s->current_picture_ptr= NULL; //so we can detect if frame_end wasnt called (find some nicer solution...)
 
41
     }
 
42
-    return buf_size;
 
43
+    return avpkt->size;
 
44
 }
 
45
 
 
46
 av_cold int ff_rv34_decode_end(AVCodecContext *avctx)
 
47
-- 
 
48
1.7.4.1
 
49