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

« back to all changes in this revision

Viewing changes to debian/patches/post-0.7.1/0049-indeo2-fail-if-input-buffer-too-small.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 6550e2b5c51cf7d3d40f666f6966b57f622ffffc Mon Sep 17 00:00:00 2001
 
2
From: Alex Converse <alex.converse@gmail.com>
 
3
Date: Fri, 9 Sep 2011 13:26:49 -0700
 
4
Subject: [PATCH 49/70] indeo2: fail if input buffer too small
 
5
 
 
6
(cherry picked from commit b7ce4f1d1c3add86ece7ca595ea6c4a10b471055)
 
7
 
 
8
Signed-off-by: Anton Khirnov <anton@khirnov.net>
 
9
---
 
10
 libavcodec/indeo2.c |    8 +++++++-
 
11
 1 files changed, 7 insertions(+), 1 deletions(-)
 
12
 
 
13
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
 
14
index 6cf893b..544f476 100644
 
15
--- a/libavcodec/indeo2.c
 
16
+++ b/libavcodec/indeo2.c
 
17
@@ -156,6 +156,13 @@ static int ir2_decode_frame(AVCodecContext *avctx,
 
18
         return -1;
 
19
     }
 
20
 
 
21
+    start = 48; /* hardcoded for now */
 
22
+
 
23
+    if (start >= buf_size) {
 
24
+        av_log(s->avctx, AV_LOG_ERROR, "input buffer size too small (%d)\n", buf_size);
 
25
+        return AVERROR_INVALIDDATA;
 
26
+    }
 
27
+
 
28
     s->decode_delta = buf[18];
 
29
 
 
30
     /* decide whether frame uses deltas or not */
 
31
@@ -163,7 +170,6 @@ static int ir2_decode_frame(AVCodecContext *avctx,
 
32
     for (i = 0; i < buf_size; i++)
 
33
         buf[i] = av_reverse[buf[i]];
 
34
 #endif
 
35
-    start = 48; /* hardcoded for now */
 
36
 
 
37
     init_get_bits(&s->gb, buf + start, (buf_size - start) * 8);
 
38
 
 
39
-- 
 
40
1.7.4.1
 
41