1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 02_SECURITY_ffmpeg_video_overflow.dpatch by Marc Deslauriers <marc.deslauriers@ubuntu.com>
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
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
13
su = this->av_frame->data[1];
14
sv = this->av_frame->data[2];
16
+ /* Some segfaults & heap corruption have been observed with img->height,
17
+ * so we use this->bih.biHeight instead (which is the displayed height)
20
if (this->context->pix_fmt == PIX_FMT_YUV410P) {
28
+ this->bih.biHeight);
30
} else if (this->context->pix_fmt == PIX_FMT_YUV411P) {
37
+ this->bih.biHeight);
39
} else if (this->context->pix_fmt == PIX_FMT_RGBA32) {
42
uint32_t *argb_pixels;
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++) {
54
- for(y = 0; y < img->height; y++) {
55
+ for(y = 0; y < this->bih.biHeight; y++) {
57
for(x = 0; x < img->width; x++) {
63
- for(y = 0; y < img->height; y++) {
64
+ for(y = 0; y < this->bih.biHeight; y++) {
66
for(x = 0; x < img->width; x++) {
72
- for(y = 0; y < img->height; y++) {
73
+ for(y = 0; y < this->bih.biHeight; y++) {
75
for(x = 0; x < img->width; x++) {
81
- for(y = 0; y < img->height; y++) {
82
+ for(y = 0; y < this->bih.biHeight; y++) {
84
for(x = 0; x < img->width; x++) {
87
v_palette[x] = COMPUTE_V(r, g, b);
90
- for(y = 0; y < img->height; y++) {
91
+ for(y = 0; y < this->bih.biHeight; y++) {
93
for(x = 0; x < img->width; x++) {
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);
103
dy += img->pitches[0];
105
sy += this->av_frame->linesize[0];
108
- for (y=0; y<(img->height/2); y++) {
109
+ for (y = 0; y < this->bih.biHeight / 2; y++) {
111
if (this->context->pix_fmt != PIX_FMT_YUV444P) {