diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index b565c1076c..3a3c46e0bc 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -215,6 +215,8 @@ static void restore_median(uint8_t *src, int step, int stride, slice_height = ((((slice + 1) * height) / slices) & cmask) - slice_start; + if (!slice_height) + continue; bsrc = src + slice_start * stride; // first line - left neighbour prediction @@ -270,6 +272,8 @@ static void restore_median_il(uint8_t *src, int step, int stride, slice_height = ((((slice + 1) * height) / slices) & cmask) - slice_start; slice_height >>= 1; + if (!slice_height) + continue; bsrc = src + slice_start * stride;