Browse code

avfilter/vf_fspp: check count before calling row_idct()

Fixes crash with odd widths

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

Michael Niedermayer authored on 2015/01/29 00:26:00
Showing 1 changed files
... ...
@@ -221,7 +221,8 @@ static void filter(FSPPContext *p, uint8_t *dst, uint8_t *src,
221 221
             p->row_fdct(block + 8 * 8, p->src + y * stride + 8 + x0 + 2 - (y & 1), stride, (es - 4) >> 2);
222 222
 
223 223
         p->column_fidct((int16_t *)(&p->threshold_mtx[0]), block, block3, es&(~1));
224
-        p->row_idct(block3 + 0 * 8, p->temp + (y & 15) * stride + x0 + 2 - (y & 1), stride, es >> 2);
224
+        if (es > 3)
225
+            p->row_idct(block3 + 0 * 8, p->temp + (y & 15) * stride + x0 + 2 - (y & 1), stride, es >> 2);
225 226
 
226 227
         if (!(y1 & 7) && y1) {
227 228
             if (y1 & 8)