avcodec/vc1: fix calculation of the last line of a slice
[ffmpeg.git] / libavcodec / dca_xll.c
index b7331e0..d265cab 100644 (file)
@@ -1028,7 +1028,7 @@ static int parse_band_data(DCAXllDecoder *s)
                             return ret;
                         chs_clear_band_data(s, c, band, seg);
                     }
-                    s->gb.index = navi_pos;
+                    skip_bits_long(&s->gb, navi_pos - get_bits_count(&s->gb));
                 }
                 navi_ptr++;
             }
@@ -1312,7 +1312,7 @@ static int combine_residual_frame(DCAXllDecoder *s, DCAXllChSet *c)
         } else {
             // No downmix scaling
             for (n = 0; n < nsamples; n++)
-                dst[n] += (src[n] + round) >> shift;
+                dst[n] += (unsigned)((src[n] + round) >> shift);
         }
     }