Browse code

Merge remote-tracking branch 'qatar/release/9' into release/1.1

* qatar/release/9:
hqdn3d: Fix out of array read in LOWPASS
vf_gradfun: fix uninitialized variable use

Conflicts:
libavfilter/vf_hqdn3d.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2013/03/18 11:11:58
Showing 2 changed files
... ...
@@ -201,12 +201,13 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in)
201 201
     GradFunContext *gf = inlink->dst->priv;
202 202
     AVFilterLink *outlink = inlink->dst->outputs[0];
203 203
     AVFilterBufferRef *out;
204
-    int p, direct = 0;
204
+    int p, direct;
205 205
 
206 206
     if (in->perms & AV_PERM_WRITE) {
207 207
         direct = 1;
208 208
         out = in;
209 209
     } else {
210
+        direct = 0;
210 211
         out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
211 212
         if (!out) {
212 213
             avfilter_unref_bufferp(&in);
... ...
@@ -50,9 +50,10 @@ void ff_hqdn3d_row_10_x86(uint8_t *src, uint8_t *dst, uint16_t *line_ant, uint16
50 50
 void ff_hqdn3d_row_16_x86(uint8_t *src, uint8_t *dst, uint16_t *line_ant, uint16_t *frame_ant, ptrdiff_t w, int16_t *spatial, int16_t *temporal);
51 51
 
52 52
 #define LUT_BITS (depth==16 ? 8 : 4)
53
-#define LOAD(x) (((depth==8 ? src[x] : AV_RN16A(src+(x)*2)) << (16-depth)) + (((1<<(16-depth))-1)>>1))
54
-#define STORE(x,val) (depth==8 ? dst[x] = (val) >> (16-depth)\
55
-                    : AV_WN16A(dst+(x)*2, (val) >> (16-depth)))
53
+#define LOAD(x) (((depth == 8 ? src[x] : AV_RN16A(src + (x) * 2)) << (16 - depth))\
54
+                 + (((1 << (16 - depth)) - 1) >> 1))
55
+#define STORE(x,val) (depth == 8 ? dst[x] = (val) >> (16 - depth) : \
56
+                                   AV_WN16A(dst + (x) * 2, (val) >> (16 - depth)))
56 57
 
57 58
 av_always_inline
58 59
 static uint32_t lowpass(int prev, int cur, int16_t *coef, int depth)