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

« back to all changes in this revision

Viewing changes to debian/patches/security/libavcodec/vorbis_dec/0009-Check-begin-end-partition_size.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 d71f5b5b2b9f2e0ba2da67ca2c15b9bbb69ac1fc Mon Sep 17 00:00:00 2001
 
2
From: michael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
 
3
Date: Wed, 23 Sep 2009 13:08:48 +0000
 
4
Subject: [PATCH 09/12] Check begin/end/partition_size.
 
5
 23_vorbis_sane_partition.patch by chrome.
 
6
 Also this should be better documented but i prefer not to leave potential
 
7
 security issues open due to missing documentation.
 
8
 
 
9
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19996 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
 
10
---
 
11
 libavcodec/vorbis_dec.c |    9 +++++++++
 
12
 1 files changed, 9 insertions(+), 0 deletions(-)
 
13
 
 
14
diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c
 
15
index ca43e99..ec3c561 100644
 
16
--- a/libavcodec/vorbis_dec.c
 
17
+++ b/libavcodec/vorbis_dec.c
 
18
@@ -37,6 +37,7 @@
 
19
 #define V_NB_BITS 8
 
20
 #define V_NB_BITS2 11
 
21
 #define V_MAX_VLCS (1<<16)
 
22
+#define V_MAX_PARTITIONS (1<<20)
 
23
 
 
24
 #ifndef V_DEBUG
 
25
 #define AV_DEBUG(...)
 
26
@@ -638,6 +639,14 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc){
 
27
         res_setup->begin=get_bits(gb, 24);
 
28
         res_setup->end=get_bits(gb, 24);
 
29
         res_setup->partition_size=get_bits(gb, 24)+1;
 
30
+        /* Validations to prevent a buffer overflow later. */
 
31
+        if (res_setup->begin>res_setup->end
 
32
+        || res_setup->end>vc->blocksize[1]/(res_setup->type==2?1:2)
 
33
+        || (res_setup->end-res_setup->begin)/res_setup->partition_size>V_MAX_PARTITIONS) {
 
34
+            av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %d, %d, %d, %d, %d\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1]/2);
 
35
+            return 1;
 
36
+        }
 
37
+
 
38
         res_setup->classifications=get_bits(gb, 6)+1;
 
39
         res_setup->classbook=get_bits(gb, 8);
 
40
         if (res_setup->classbook>=vc->codebook_count) {
 
41
-- 
 
42
1.6.3.3
 
43