~ubuntu-branches/debian/experimental/ffmpeg/experimental

« back to all changes in this revision

Viewing changes to debian/patches/security/libavformat/oggparsevorbis/0001-Fix-possible-buffer-over-read-in-vorbis_comment-fix-.patch

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler, Loïc Minier, Fabian Greffrath, Andres Mejia, Reinhard Tartler
  • Date: 2010-01-06 16:27:40 UTC
  • Revision ID: james.westby@ubuntu.com-20100106162740-w0c7o1bxg8xf9psx
Tags: 4:0.5+svn20090706-3
[ Loïc Minier ]
* Disable more autodetecter ARM arch features
* Enable neon flavour
* Update NEON confflags to assume v7 and VFP
* Add backported NEON patches from ffmpeg trunk
* Pass proper --cpu and --extra-flags on armel
* Pass -fPIC -DPIC to neon pass

[ Fabian Greffrath ]
* Initialize the FLAVORS variable to static instead of appending to
  it. Also, we do not support the internalencoders variable anymore.

[ Andres Mejia ]
* Remove unused patches from packaging.
* Update Vcs-* entries to new location.
* Bump Standards-Version to 3.8.3.

[ Reinhard Tartler ]
* change shlibs file to make applications depend on the -extra- packages
* loosen dependencies further, so that the -dev packages remain
  installable even if ffmpeg-extra is 'out-of-date'
* add patch for issue1245: Make arguments of av_set_pts_info() unsigned.
* Support constant-quant encoding for libtheora, LP: #356322
* increase swscale compile time width (VOF/VOFW), LP: #443264
* Backports of various security patches, Closes: #550442, including:
   - backport fixes for vorbis_dec
   - backport oggparsevorbis fix
   - backport vp3 fixes
   - backport ffv1 fix
   - libavcodec/mpegaudiodec.c backports
   - h264 security backports
   - backported libavformat/mov.c security fixes
   - backported libavformat/oggdec.c security fixes
   - backport svn r18016 aka 'MOV-Support-stz2-Compact-Sample-Size-Box'
     to fix FTBFS
* enable symbol versioning
* bump shlibs version
* add README.source describing how this source package manages patches
* make sure the ${misc:Depends} substvar is used for each binary package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From fdf622ded070640a924e63a6e630325520d0b567 Mon Sep 17 00:00:00 2001
 
2
From: reimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
 
3
Date: Thu, 24 Sep 2009 15:37:09 +0000
 
4
Subject: [PATCH] Fix possible buffer over-read in vorbis_comment, fix it double to be sure.
 
5
 First, make s signed, so that comparisons against end - p will not be made as
 
6
 unsigned, making the check incorrectly pass if p is beyond end.
 
7
 Also ensure that p will never be > end, so the code is correct also if
 
8
 buf is not padded.
 
9
 
 
10
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20014 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
 
11
---
 
12
 libavformat/oggparsevorbis.c |    9 +++++----
 
13
 1 files changed, 5 insertions(+), 4 deletions(-)
 
14
 
 
15
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
 
16
index afc3fcb..1ef7365 100644
 
17
--- a/libavformat/oggparsevorbis.c
 
18
+++ b/libavformat/oggparsevorbis.c
 
19
@@ -50,27 +50,28 @@ vorbis_comment(AVFormatContext * as, uint8_t *buf, int size)
 
20
 {
 
21
     const uint8_t *p = buf;
 
22
     const uint8_t *end = buf + size;
 
23
-    unsigned s, n, j;
 
24
+    unsigned n, j;
 
25
+    int s;
 
26
 
 
27
     if (size < 8) /* must have vendor_length and user_comment_list_length */
 
28
         return -1;
 
29
 
 
30
     s = bytestream_get_le32(&p);
 
31
 
 
32
-    if (end - p < s)
 
33
+    if (end - p - 4 < s || s < 0)
 
34
         return -1;
 
35
 
 
36
     p += s;
 
37
 
 
38
     n = bytestream_get_le32(&p);
 
39
 
 
40
-    while (p < end && n > 0) {
 
41
+    while (end - p >= 4 && n > 0) {
 
42
         const char *t, *v;
 
43
         int tl, vl;
 
44
 
 
45
         s = bytestream_get_le32(&p);
 
46
 
 
47
-        if (end - p < s)
 
48
+        if (end - p < s || s < 0)
 
49
             break;
 
50
 
 
51
         t = p;
 
52
-- 
 
53
1.6.3.3
 
54