mirror of
https://github.com/librempeg/librempeg
synced 2024-11-22 09:02:20 +00:00
avcodec/smcenc: make sure ny/nx are >= 0
This commit is contained in:
parent
8d12c7ab72
commit
5ad38785e7
@ -184,8 +184,8 @@ static void smc_encode_stream(SMCContext *s, const AVFrame *frame,
|
||||
const ptrdiff_t offset = xpixel_ptr - src_pixels;
|
||||
const int sy = offset / stride;
|
||||
const int sx = offset % stride;
|
||||
const int ny = sx < 4 ? sy - 4 : sy;
|
||||
const int nx = sx < 4 ? width - 4 + (width & 3) : sx - 4;
|
||||
const int ny = sx < 4 ? FFMAX(sy - 4, 0) : sy;
|
||||
const int nx = sx < 4 ? FFMAX(width - 4 + (width & 3), 0) : sx - 4;
|
||||
const uint8_t *old_pixel_ptr = src_pixels + nx + ny * stride;
|
||||
int compare = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user