diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-06-26 18:49:00 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-06-27 11:29:34 +0200 |
commit | cdeb803e2fe1239e0217186c7441c94adb0d9895 (patch) | |
tree | 14f6db54e7e3ae5a3540c1fd7668d310b4375e4f | |
parent | 9df1d329a5ac718dd9459ed37acdbbc88adc31e3 (diff) | |
download | ffmpeg-cdeb803e2fe1239e0217186c7441c94adb0d9895.tar.gz |
vf_lut: fix draw_slice() in case of non packed image data for packed RGB
The previous code was erroneously assuming that the linesize was
equivalent to width*pixel_step, which is not always true.
-rw-r--r-- | libavfilter/vf_lut.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c index c457972474..fdab6941a4 100644 --- a/libavfilter/vf_lut.c +++ b/libavfilter/vf_lut.c @@ -306,21 +306,25 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) AVFilterLink *outlink = ctx->outputs[0]; AVFilterBufferRef *inpic = inlink ->cur_buf; AVFilterBufferRef *outpic = outlink->out_buf; - uint8_t *inrow, *outrow; + uint8_t *inrow, *outrow, *inrow0, *outrow0; int i, j, k, plane; if (lut->is_rgb) { /* packed */ - inrow = inpic ->data[0] + y * inpic ->linesize[0]; - outrow = outpic->data[0] + y * outpic->linesize[0]; + inrow0 = inpic ->data[0] + y * inpic ->linesize[0]; + outrow0 = outpic->data[0] + y * outpic->linesize[0]; for (i = 0; i < h; i ++) { + inrow = inrow0; + outrow = outrow0; for (j = 0; j < inlink->w; j++) { for (k = 0; k < lut->step; k++) outrow[k] = lut->lut[lut->rgba_map[k]][inrow[k]]; outrow += lut->step; inrow += lut->step; } + inrow0 += inpic ->linesize[0]; + outrow0 += outpic->linesize[0]; } } else { /* planar */ |