Merge commit '7251de30322aff5660e571856132dc6c7256fe94' into release/1.1
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 2 Jun 2013 23:02:28 +0000 (01:02 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 2 Jun 2013 23:09:23 +0000 (01:09 +0200)
* commit '7251de30322aff5660e571856132dc6c7256fe94':
  wavpack: use bytestream2 in wavpack_decode_block

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/wavpack.c

@@@ -1037,15 -1045,24 +1052,24 @@@ static int wavpack_decode_block(AVCodec
                  av_log(avctx, AV_LOG_ERROR, "Insufficient channel information\n");
                  return AVERROR_INVALIDDATA;
              }
-             chan = *buf++;
+             chan = bytestream2_get_byte(&gb);
              switch (size - 2) {
-             case 0: chmask = *buf;         break;
-             case 1: chmask = AV_RL16(buf); break;
-             case 2: chmask = AV_RL24(buf); break;
-             case 3: chmask = AV_RL32(buf); break;
+             case 0:
+                 chmask = bytestream2_get_byte(&gb);
+                 break;
+             case 1:
+                 chmask = bytestream2_get_le16(&gb);
+                 break;
+             case 2:
+                 chmask = bytestream2_get_le24(&gb);
+                 break;
+             case 3:
 -                chmask = bytestream2_get_le32(&gb);;
++                chmask = bytestream2_get_le32(&gb);
+                 break;
              case 5:
-                 chan |= (buf[1] & 0xF) << 8;
-                 chmask = AV_RL24(buf + 2);
+                 bytestream2_skip(&gb, 1);
+                 chan  |= (bytestream2_get_byte(&gb) & 0xF) << 8;
+                 chmask = bytestream2_get_le16(&gb);
                  break;
              default:
                  av_log(avctx, AV_LOG_ERROR, "Invalid channel info size %d\n",