aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-12 18:25:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-12 18:25:32 +0200
commita457115f0f09b1868aa4c3a0eeca2e1b3f0dd78b (patch)
tree7def240343e626091023293c6a833baea89eb4b9
parent90241187ceb6f3aa34e2783d0b69c3781af4026f (diff)
parent3aebdffb010df025728d6c2af89642f9634aa806 (diff)
downloadffmpeg-a457115f0f09b1868aa4c3a0eeca2e1b3f0dd78b.tar.gz
Merge commit '3aebdffb010df025728d6c2af89642f9634aa806' into release/0.10
* commit '3aebdffb010df025728d6c2af89642f9634aa806': cdgraphics: switch to bytestream2 Conflicts: libavcodec/cdgraphics.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/cdgraphics.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c
index 1bba406478..13ffc7d8bd 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -268,7 +268,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data,
static int cdg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size, AVPacket *avpkt)
{
- const uint8_t *buf = avpkt->data;
+ GetByteContext gb;
int buf_size = avpkt->size;
int ret;
uint8_t command, inst;
@@ -285,17 +285,19 @@ static int cdg_decode_frame(AVCodecContext *avctx,
return AVERROR(EINVAL);
}
+ bytestream2_init(&gb, avpkt->data, avpkt->size);
+
ret = avctx->reget_buffer(avctx, &cc->frame);
if (ret) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret;
}
- command = bytestream_get_byte(&buf);
- inst = bytestream_get_byte(&buf);
+ command = bytestream2_get_byte(&gb);
+ inst = bytestream2_get_byte(&gb);
inst &= CDG_MASK;
- buf += 2; /// skipping 2 unneeded bytes
- bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
+ bytestream2_skip(&gb, 2);
+ bytestream2_get_buffer(&gb, cdg_data, sizeof(cdg_data));
if ((command & CDG_MASK) == CDG_COMMAND) {
switch (inst) {