On 04/11/14 15:36, Vittorio Giovara wrote:
Makes coverity less confused.

CC: [email protected]
Bug-Id: CID 751744
---
  libavcodec/mpeg12enc.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 3376f10..96130ea 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) {


And makes the code readable.

Ok.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to