diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-12-07 18:51:33 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-12-07 19:43:19 +0100 |
commit | 130c6497d2e511d1363cb51ddf68dc9cc2c2f987 (patch) | |
tree | 0631d162ee694d6e4bf56d29d8ee49531d821233 | |
parent | c3ad91a3d77c97e029b42d1f0e511874342bfb92 (diff) | |
download | ffmpeg-130c6497d2e511d1363cb51ddf68dc9cc2c2f987.tar.gz |
lavfi/alphaextract: fix assignment of invalid size value to memcpy in case linesize < 0
Fix crash, for example in the command:
ffmpeg -f image2 -vcodec pgmyuv -i tests/vsynth1/%02d.pgm \
-vf "[in]format=yuv420p,split,alphamerge,split[o3][o4];
[o4]vflip,alphaextract[alpha];[o3][alpha]alphamerge[out]" \
-vcodec rawvideo -f nut md5:
-rw-r--r-- | libavfilter/vf_alphaextract.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_alphaextract.c b/libavfilter/vf_alphaextract.c index 60de6ac2ba..f930c51290 100644 --- a/libavfilter/vf_alphaextract.c +++ b/libavfilter/vf_alphaextract.c @@ -87,7 +87,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *cur_buf) } } } else { - const int linesize = FFMIN(out_buf->linesize[Y], cur_buf->linesize[A]); + const int linesize = abs(FFMIN(out_buf->linesize[Y], cur_buf->linesize[A])); int y; for (y = 0; y < out_buf->video->h; y++) { memcpy(out_buf->data[Y] + y * out_buf->linesize[Y], |