X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Futvideodec.c;h=b565c1076c6a82a18ad1268f8ef08e5c8684b0cd;hp=afd56ea1bdf6ed9860e21e147443e55a32f6190f;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavcodec/utvideodec.c b/ffmpeg/libavcodec/utvideodec.c index afd56ea..b565c10 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); @@ -224,7 +225,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]; @@ -284,7 +285,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];