mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
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:
This commit is contained in:
parent
c3ad91a3d7
commit
130c6497d2
@ -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],
|
||||
|
Loading…
x
Reference in New Issue
Block a user