summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12enc.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-11-04 09:36:57 -0500
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-11-06 10:44:46 -0500
commit37b3361e755361d4ff14a2973df001c0140d98d6 (patch)
tree129272f6cf76011ba14afa2804209fdd413ec3cb /libavcodec/mpeg12enc.c
parent0a6664706168dc1049967bec311970d720581625 (diff)
mpeg12enc: factor out check in encode_dc
Makes coverity less confused and the code more readable. CC: libav-stable@libav.org Bug-Id: CID 751744
Diffstat (limited to 'libavcodec/mpeg12enc.c')
-rw-r--r--libavcodec/mpeg12enc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 3376f1075f..96130eaa0f 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -546,7 +546,8 @@ static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code)
static inline void encode_dc(MpegEncContext *s, int diff, int component)
{
- if (((unsigned) (diff + 255)) >= 511) {
+ unsigned int diff_u = diff + 255;
+ if (diff_u >= 511) {
int index;
if (diff < 0) {