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

« back to all changes in this revision

Viewing changes to debian/patches/post-0.7.1/0067-rv34-Check-for-invalid-slice-offsets.patch

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2011-10-01 00:22:07 UTC
  • mfrom: (1.3.8 sid)
  • Revision ID: package-import@ubuntu.com-20111001002207-tnxz39i0rwr5ufy9
Tags: 4:0.7.2-1ubuntu1
* Merge from debian, remaining changes:
  - don't build against libfaad, libdirac, librtmp and libopenjpeg,
    lame, xvid, x264  (all in universe)
  - not installing into multiarch directories
* This new upstream release has basically merged in all 70 patches that
  are present in 4:0.7.1-7ubuntu2, plus some additional, similarily
  focused ones.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 2bbb142a140173e1870017b66c439f4d430a6f67 Mon Sep 17 00:00:00 2001
2
 
From: Laurent Aimar <fenrir@videolan.org>
3
 
Date: Mon, 19 Sep 2011 22:48:53 +0200
4
 
Subject: [PATCH 67/70] rv34: Check for invalid slice offsets
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 4cc7732386eb36661ed22d1200339b38a5fa60bc)
11
 
 
12
 
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13
 
---
14
 
 libavcodec/rv34.c |    9 +++++----
15
 
 1 files changed, 5 insertions(+), 4 deletions(-)
16
 
 
17
 
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
18
 
index 87fca5c..70c35ef 100644
19
 
--- a/libavcodec/rv34.c
20
 
+++ b/libavcodec/rv34.c
21
 
@@ -1441,8 +1441,9 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
22
 
         slice_count = avctx->slice_count;
23
 
 
24
 
     //parse first slice header to check whether this frame can be decoded
25
 
-    if(get_slice_offset(avctx, slices_hdr, 0) > buf_size){
26
 
-        av_log(avctx, AV_LOG_ERROR, "Slice offset is greater than frame size\n");
27
 
+    if(get_slice_offset(avctx, slices_hdr, 0) < 0 ||
28
 
+       get_slice_offset(avctx, slices_hdr, 0) > buf_size){
29
 
+        av_log(avctx, AV_LOG_ERROR, "Slice offset is invalid\n");
30
 
         return -1;
31
 
     }
32
 
     init_get_bits(&s->gb, buf+get_slice_offset(avctx, slices_hdr, 0), (buf_size-get_slice_offset(avctx, slices_hdr, 0))*8);
33
 
@@ -1465,8 +1466,8 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
34
 
         else
35
 
             size= get_slice_offset(avctx, slices_hdr, i+1) - offset;
36
 
 
37
 
-        if(offset > buf_size){
38
 
-            av_log(avctx, AV_LOG_ERROR, "Slice offset is greater than frame size\n");
39
 
+        if(offset < 0 || offset > buf_size || size < 0){
40
 
+            av_log(avctx, AV_LOG_ERROR, "Slice offset is invalid\n");
41
 
             break;
42
 
         }
43
 
 
44
 
1.7.4.1
45