escape124: explicitly set get_bits1 variable

Message ID 20141113004711.3D67A5DFC8@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau Nov. 13, 2014, 12:47 a.m.
Module: libav
Branch: master
Commit: 1a9c1333b5d70b427c82cb98f383aa2fa9b2b319

Author:    Vittorio Giovara <vittorio.giovara@gmail.com>
Committer: Vittorio Giovara <vittorio.giovara@gmail.com>
Date:      Tue Nov 11 17:40:09 2014 +0100

escape124: explicitly set get_bits1 variable

Makes coverity less confused.

CC: libav-stable@libav.org
Bug-Id: CID 1203487

---

 libavcodec/escape124.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c
index 30f22e0..6c4654c 100644
--- a/libavcodec/escape124.c
+++ b/libavcodec/escape124.c
@@ -147,10 +147,11 @@  static MacroBlock decode_macroblock(Escape124Context* s, GetBitContext* gb,
     // This function reads a maximum of 22 bits; the callers
     // guard this function appropriately
     unsigned block_index, depth;
-
-    if (get_bits1(gb)) {
+    int value = get_bits1(gb);
+    if (value) {
         static const char transitions[3][2] = { {2, 1}, {0, 2}, {1, 0} };
-        *codebook_index = transitions[*codebook_index][get_bits1(gb)];
+        value = get_bits1(gb);
+        *codebook_index = transitions[*codebook_index][value];
     }
 
     depth = s->codebooks[*codebook_index].depth;