misc: Put git-version-gen into the tarball
[osmocom-bb.git] / src / conv.c
index cf820a3..70bdffb 100644 (file)
@@ -389,9 +389,12 @@ osmo_conv_decode_finish(struct osmo_conv_decoder *decoder,
                        m = 1 << (code->N - 1);         /* mask for 'out' bit selection */
 
                        for (j=0; j<code->N; j++) {
-                               ov = (out & m) ? -127 : 127; /* sbit_t value for it */
-                               e = ((int)in_sym[j]) - ov;   /* raw error for this bit */
-                               nae += (e * e) >> 9;         /* acc the squared/scaled value */
+                               int is = (int)in_sym[j];
+                               if (is) {
+                                       ov = (out & m) ? -127 : 127; /* sbit_t value for it */
+                                       e = is - ov;                 /* raw error for this bit */
+                                       nae += (e * e) >> 9;         /* acc the squared/scaled value */
+                               }
                                m >>= 1;                     /* next mask bit */
                        }