~ubuntu-branches/ubuntu/intrepid/xine-lib/intrepid-updates

« back to all changes in this revision

Viewing changes to debian/patches/02_SECURITY_ffmpeg_video_overflow.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2009-01-21 08:32:25 UTC
  • Revision ID: james.westby@ubuntu.com-20090121083225-gca4jd9ig6r7qv2b
Tags: 1.1.15-0ubuntu3.1
* SECURITY UPDATE: backported security fixes from upstream xine-lib hg repo:
  - debian/patches/01_SECURITY_invalid_track_type.dpatch: Avoid segfault on
    invalid track type in Matroska files.
  - debian/patches/02_SECURITY_ffmpeg_video_overflow.dpatch: Heap buffer
    overflow in the ffmpeg video decoder.
  - debian/patches/03_SECURITY_ffmpeg_audio_overflow.dpatch: Integer overflow
    in the ffmpeg audio decoder
  - debian/patches/04_SECURITY_cdda_server_overflow.dpatch: Integer overflow
    in the the CDDA server.
  - debian/patches/05_SECURITY_CVE-2008-5234.dpatch: Heap overflow and
    unchecked malloc in Quicktime atom parsing. (CVE-2008-5234, CVE-2008-5242)
  - debian/patches/06_SECURITY_CVE-2008-5236.dpatch: Buffer overflows in
    Matroska, Real and RealAudio demuxers. (CVE-2008-5236)
  - debian/patches/07_SECURITY_CVE-2008-5237.dpatch: Integer overflows in
    MNG and QT demuxers. (CVE-2008-5237)
  - debian/patches/08_SECURITY_CVE-2008-5239.dpatch: Out-of-bounds reads and
    heap-based buffer overflows from unchecked or incompletely-checked read
    function results. (CVE-2008-5239)
  - debian/patches/09_SECURITY_CVE-2008-5240.dpatch: Unchecked malloc using
    untrusted values. (CVE-2008-5240)
  - debian/patches/10_SECURITY_CVE-2008-5241.dpatch: Integer underflow in qt
    compressed atom handling. (CVE-2008-5241)
  - debian/patches/11_SECURITY_CVE-2008-5243.dpatch: Buffer indexing using
    untrusted or unchecked values. (CVE-2008-5243)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 02_SECURITY_ffmpeg_video_overflow.dpatch by Marc Deslauriers <marc.deslauriers@ubuntu.com>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Description: fix heap buffer overflow in the ffmpeg video decoder.
 
6
## DP: Patch: http://hg.debian.org/hg/xine-lib/xine-lib?cmd=changeset;node=ffb2e82d7bb77e87492734f72c2e5d21fb9ad2c0;style=gitweb
 
7
 
 
8
@DPATCH@
 
9
diff -urNad xine-lib-1.1.15~/src/combined/ffmpeg/ff_video_decoder.c xine-lib-1.1.15/src/combined/ffmpeg/ff_video_decoder.c
 
10
--- xine-lib-1.1.15~/src/combined/ffmpeg/ff_video_decoder.c     2008-07-16 17:01:56.000000000 -0400
 
11
+++ xine-lib-1.1.15/src/combined/ffmpeg/ff_video_decoder.c      2009-01-15 09:47:43.000000000 -0500
 
12
@@ -606,6 +606,10 @@
 
13
   su = this->av_frame->data[1];
 
14
   sv = this->av_frame->data[2];
 
15
 
 
16
+  /* Some segfaults & heap corruption have been observed with img->height,
 
17
+   * so we use this->bih.biHeight instead (which is the displayed height)
 
18
+   */
 
19
+
 
20
   if (this->context->pix_fmt == PIX_FMT_YUV410P) {
 
21
 
 
22
     yuv9_to_yv12(
 
23
@@ -626,7 +630,7 @@
 
24
       img->pitches[2],
 
25
      /* width x height */
 
26
       img->width,
 
27
-      img->height);
 
28
+      this->bih.biHeight);
 
29
 
 
30
   } else if (this->context->pix_fmt == PIX_FMT_YUV411P) {
 
31
 
 
32
@@ -648,7 +652,7 @@
 
33
       img->pitches[2],
 
34
      /* width x height */
 
35
       img->width,
 
36
-      img->height);
 
37
+      this->bih.biHeight);
 
38
 
 
39
   } else if (this->context->pix_fmt == PIX_FMT_RGBA32) {
 
40
           
 
41
@@ -656,7 +660,7 @@
 
42
     uint32_t *argb_pixels;
 
43
     uint32_t argb;
 
44
 
 
45
-    for(y = 0; y < img->height; y++) {
 
46
+    for(y = 0; y < this->bih.biHeight; y++) {
 
47
       argb_pixels = (uint32_t *)sy;
 
48
       for(x = 0; x < img->width; x++) {
 
49
         uint8_t r, g, b;
 
50
@@ -684,7 +688,7 @@
 
51
     uint8_t *src;
 
52
     uint16_t pixel16;
 
53
 
 
54
-    for(y = 0; y < img->height; y++) {
 
55
+    for(y = 0; y < this->bih.biHeight; y++) {
 
56
       src = sy;
 
57
       for(x = 0; x < img->width; x++) {
 
58
         uint8_t r, g, b;
 
59
@@ -713,7 +717,7 @@
 
60
     uint8_t *src;
 
61
     uint16_t pixel16;
 
62
             
 
63
-    for(y = 0; y < img->height; y++) {
 
64
+    for(y = 0; y < this->bih.biHeight; y++) {
 
65
       src = sy;
 
66
       for(x = 0; x < img->width; x++) {
 
67
         uint8_t r, g, b;
 
68
@@ -741,7 +745,7 @@
 
69
     int x, plane_ptr = 0;
 
70
     uint8_t *src;
 
71
 
 
72
-    for(y = 0; y < img->height; y++) {
 
73
+    for(y = 0; y < this->bih.biHeight; y++) {
 
74
       src = sy;
 
75
       for(x = 0; x < img->width; x++) {
 
76
         uint8_t r, g, b;
 
77
@@ -765,7 +769,7 @@
 
78
     int x, plane_ptr = 0;
 
79
     uint8_t *src;
 
80
 
 
81
-    for(y = 0; y < img->height; y++) {
 
82
+    for(y = 0; y < this->bih.biHeight; y++) {
 
83
       src = sy;
 
84
       for(x = 0; x < img->width; x++) {
 
85
         uint8_t r, g, b;
 
86
@@ -808,7 +812,7 @@
 
87
       v_palette[x] = COMPUTE_V(r, g, b);
 
88
     }
 
89
 
 
90
-    for(y = 0; y < img->height; y++) {
 
91
+    for(y = 0; y < this->bih.biHeight; y++) {
 
92
       src = sy;
 
93
       for(x = 0; x < img->width; x++) {
 
94
         pixel = *src++;
 
95
@@ -825,7 +829,7 @@
 
96
           
 
97
   } else {
 
98
           
 
99
-    for (y=0; y<img->height; y++) {
 
100
+    for (y = 0; y < this->bih.biHeight; y++) {
 
101
       xine_fast_memcpy (dy, sy, img->width);
 
102
   
 
103
       dy += img->pitches[0];
 
104
@@ -833,7 +837,7 @@
 
105
       sy += this->av_frame->linesize[0];
 
106
     }
 
107
 
 
108
-    for (y=0; y<(img->height/2); y++) {
 
109
+    for (y = 0; y < this->bih.biHeight / 2; y++) {
 
110
       
 
111
       if (this->context->pix_fmt != PIX_FMT_YUV444P) {
 
112