avcodec/pixlet: clip chroma before shifting

Fixes artifacts.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pull/249/head
Paul B Mahol 8 years ago
parent 1daa08bd96
commit be46eb7101
  1. 4
      libavcodec/pixlet.c

@ -482,8 +482,8 @@ static void postprocess_chroma(AVFrame *frame, int w, int h, int depth)
for (j = 0; j < h; j++) {
for (i = 0; i < w; i++) {
dstu[i] = (add + srcu[i]) << shift;
dstv[i] = (add + srcv[i]) << shift;
dstu[i] = av_clip(add + srcu[i], 0, 32767) << shift;
dstv[i] = av_clip(add + srcv[i], 0, 32767) << shift;
}
dstu += strideu;
dstv += stridev;

Loading…
Cancel
Save