~ubuntu-branches/ubuntu/quantal/libav/quantal-updates

« back to all changes in this revision

Viewing changes to libavcodec/simple_idct.c

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-03-21 21:18:24 UTC
  • mfrom: (1.2.10)
  • Revision ID: package-import@ubuntu.com-20120321211824-n63p3v3s99q3mxrb
Tags: 4:0.8.1-0ubuntu1
* New upstream bug and security fix release (FFe: LP: #960949)
  - fixes the following CVEs:
    CVE-2012-0848, CVE-2012-0853, CVE-2012-0858, CVE-2011-3929,
    CVE-2011-3936, CVE-2011-3937, CVE-2011-3940, CVE-2011-3945,
    CVE-2011-3947, CVE-2011-3951, CVE-2011-3952

* Pull fix from Debian git to fix installation of avserver.conf and
  recordshow.sh into libav-tools; Thanks to Julien Cristau for spotting this!
  - update debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
static inline void idct4col_put(uint8_t *dest, int line_size, const DCTELEM *col)
54
54
{
55
55
    int c0, c1, c2, c3, a0, a1, a2, a3;
56
 
    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
57
56
 
58
57
    a0 = col[8*0];
59
58
    a1 = col[8*2];
63
62
    c2 = ((a0 - a2) << (CN_SHIFT - 1)) + (1 << (C_SHIFT - 1));
64
63
    c1 = a1 * C1 + a3 * C2;
65
64
    c3 = a1 * C2 - a3 * C1;
66
 
    dest[0] = cm[(c0 + c1) >> C_SHIFT];
67
 
    dest += line_size;
68
 
    dest[0] = cm[(c2 + c3) >> C_SHIFT];
69
 
    dest += line_size;
70
 
    dest[0] = cm[(c2 - c3) >> C_SHIFT];
71
 
    dest += line_size;
72
 
    dest[0] = cm[(c0 - c1) >> C_SHIFT];
 
65
    dest[0] = av_clip_uint8((c0 + c1) >> C_SHIFT);
 
66
    dest += line_size;
 
67
    dest[0] = av_clip_uint8((c2 + c3) >> C_SHIFT);
 
68
    dest += line_size;
 
69
    dest[0] = av_clip_uint8((c2 - c3) >> C_SHIFT);
 
70
    dest += line_size;
 
71
    dest[0] = av_clip_uint8((c0 - c1) >> C_SHIFT);
73
72
}
74
73
 
75
74
#define BF(k) \
133
132
static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col)
134
133
{
135
134
    int c0, c1, c2, c3, a0, a1, a2, a3;
136
 
    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
137
135
 
138
136
    a0 = col[8*0];
139
137
    a1 = col[8*1];
143
141
    c2 = (a0 - a2)*C3 + (1 << (C_SHIFT - 1));
144
142
    c1 = a1 * C1 + a3 * C2;
145
143
    c3 = a1 * C2 - a3 * C1;
146
 
    dest[0] = cm[dest[0] + ((c0 + c1) >> C_SHIFT)];
147
 
    dest += line_size;
148
 
    dest[0] = cm[dest[0] + ((c2 + c3) >> C_SHIFT)];
149
 
    dest += line_size;
150
 
    dest[0] = cm[dest[0] + ((c2 - c3) >> C_SHIFT)];
151
 
    dest += line_size;
152
 
    dest[0] = cm[dest[0] + ((c0 - c1) >> C_SHIFT)];
 
144
    dest[0] = av_clip_uint8(dest[0] + ((c0 + c1) >> C_SHIFT));
 
145
    dest += line_size;
 
146
    dest[0] = av_clip_uint8(dest[0] + ((c2 + c3) >> C_SHIFT));
 
147
    dest += line_size;
 
148
    dest[0] = av_clip_uint8(dest[0] + ((c2 - c3) >> C_SHIFT));
 
149
    dest += line_size;
 
150
    dest[0] = av_clip_uint8(dest[0] + ((c0 - c1) >> C_SHIFT));
153
151
}
154
152
 
155
153
#define RN_SHIFT 15
161
159
static inline void idct4row(DCTELEM *row)
162
160
{
163
161
    int c0, c1, c2, c3, a0, a1, a2, a3;
164
 
    //const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
165
162
 
166
163
    a0 = row[0];
167
164
    a1 = row[1];