Merge commit 'd00f1e0fc10bb945cdf140a6c320eb0c9cd25162'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 6 May 2015 18:23:54 +0000 (20:23 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 6 May 2015 18:23:54 +0000 (20:23 +0200)
* commit 'd00f1e0fc10bb945cdf140a6c320eb0c9cd25162':
  quickdraw: Convert to bytestream2

Conflicts:
libavcodec/qdrw.c

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

@@@ -41,10 -40,11 +40,9 @@@ static int decode_frame(AVCodecContext 
      int colors;
      int i, ret;
      uint32_t *pal;
-     int r, g, b;
  
 -    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
 -        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
 +    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
          return ret;
 -    }
      p->pict_type = AV_PICTURE_TYPE_I;
      p->key_frame = 1;
  
  
      pal = (uint32_t*)p->data[1];
      for (i = 0; i <= colors; i++) {
-         unsigned int idx;
-         idx = AV_RB16(buf); /* color index */
-         buf += 2;
+         uint8_t r, g, b;
+         unsigned int idx = bytestream2_get_be16(&gbc); /* color index */
          if (idx > 255) {
              av_log(avctx, AV_LOG_ERROR, "Palette index out of range: %u\n", idx);
-             buf += 6;
+             bytestream2_skip(&gbc, 6);
              continue;
          }
-         r = *buf++;
-         buf++;
-         g = *buf++;
-         buf++;
-         b = *buf++;
-         buf++;
+         r = bytestream2_get_byte(&gbc);
+         bytestream2_skip(&gbc, 1);
+         g = bytestream2_get_byte(&gbc);
+         bytestream2_skip(&gbc, 1);
+         b = bytestream2_get_byte(&gbc);
+         bytestream2_skip(&gbc, 1);
 -        pal[idx] = (r << 16) | (g << 8) | b;
 +        pal[idx] = 0xFFU << 24 | r << 16 | g << 8 | b;
      }
      p->palette_has_changed = 1;