aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dirac_vlc.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-07-14 01:26:51 +0100
committerRostislav Pehlivanov <atomnuker@gmail.com>2016-07-14 01:29:34 +0100
commitf41e37b84f3d57c29d4a2a21f9337159135b981d (patch)
tree2cb045e8e1b0f63dc341ec9581c33fab607b2350 /libavcodec/dirac_vlc.c
parentc4adcff976043dd3121660a90f654d5081ea9094 (diff)
downloadffmpeg-f41e37b84f3d57c29d4a2a21f9337159135b981d.tar.gz
dirac_vlc: prevent shifting a 0 by 64 bits when zeroing residue
Adding a check for bits == 0 would still make Coverity misdetect this, so just revert to the normal way of setting the residue to 0. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/dirac_vlc.c')
-rw-r--r--libavcodec/dirac_vlc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/dirac_vlc.c b/libavcodec/dirac_vlc.c
index d874278aa6..336d22a182 100644
--- a/libavcodec/dirac_vlc.c
+++ b/libavcodec/dirac_vlc.c
@@ -65,7 +65,7 @@ int ff_dirac_golomb_read_32bit(DiracGolombLUT *lut_ctx, const uint8_t *buf,
coeff |= (res >> (RSIZE_BITS - 2*i - 2)) & 1;
}
dst[c_idx++] = l->sign * (coeff - 1);
- SET_RESIDUE(res, 0, 0);
+ res_bits = res = 0;
}
memcpy(&dst[c_idx], l->ready, LUT_BITS*sizeof(int32_t));
@@ -104,7 +104,7 @@ int ff_dirac_golomb_read_16bit(DiracGolombLUT *lut_ctx, const uint8_t *buf,
coeff |= (res >> (RSIZE_BITS - 2*i - 2)) & 1;
}
dst[c_idx++] = l->sign * (coeff - 1);
- SET_RESIDUE(res, 0, 0);
+ res_bits = res = 0;
}
for (i = 0; i < LUT_BITS; i++)