X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Futvideodec.c;h=3a3c46e0bc6695052dcd753e116efae3fd892dd8;hb=092a91210f1b986dc846dc52988518f8f913eb72;hp=afd56ea1bdf6ed9860e21e147443e55a32f6190f;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00;p=deb_ffmpeg.git diff --git a/ffmpeg/libavcodec/utvideodec.c b/ffmpeg/libavcodec/utvideodec.c index afd56ea..3a3c46e 100644 --- a/ffmpeg/libavcodec/utvideodec.c +++ b/ffmpeg/libavcodec/utvideodec.c @@ -56,13 +56,14 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym) *fsym = he[0].sym; return 0; } - if (he[0].len > 32) - return -1; last = 255; while (he[last].len == 255 && last) last--; + if (he[last].len > 32) + return -1; + code = 1; for (i = last; i >= 0; i--) { codes[i] = code >> (32 - he[i].len); @@ -214,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 @@ -224,7 +227,7 @@ static void restore_median(uint8_t *src, int step, int stride, A = bsrc[i]; } bsrc += stride; - if (slice_height == 1) + if (slice_height <= 1) continue; // second line - first element has top prediction, the rest uses median C = bsrc[-stride]; @@ -269,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; @@ -284,7 +289,7 @@ static void restore_median_il(uint8_t *src, int step, int stride, A = bsrc[stride + i]; } bsrc += stride2; - if (slice_height == 1) + if (slice_height <= 1) continue; // second line - first element has top prediction, the rest uses median C = bsrc[-stride2];