summaryrefslogtreecommitdiff
path: root/libavcodec/aasc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/aasc.c')
-rw-r--r--libavcodec/aasc.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c
index a115718a39..c2758229b3 100644
--- a/libavcodec/aasc.c
+++ b/libavcodec/aasc.c
@@ -34,17 +34,10 @@
typedef struct AascContext {
AVCodecContext *avctx;
+ GetByteContext gb;
AVFrame frame;
} AascContext;
-#define FETCH_NEXT_STREAM_BYTE() \
- if (stream_ptr >= buf_size) \
- { \
- av_log(s->avctx, AV_LOG_ERROR, " AASC: stream ptr just went out of bounds (fetch)\n"); \
- break; \
- } \
- stream_byte = buf[stream_ptr++];
-
static av_cold int aasc_decode_init(AVCodecContext *avctx)
{
AascContext *s = avctx->priv_data;
@@ -89,7 +82,8 @@ static int aasc_decode_frame(AVCodecContext *avctx,
}
break;
case 1:
- ff_msrle_decode(avctx, (AVPicture*)&s->frame, 8, buf - 4, buf_size + 4);
+ bytestream2_init(&s->gb, buf - 4, buf_size + 4);
+ ff_msrle_decode(avctx, (AVPicture*)&s->frame, 8, &s->gb);
break;
default:
av_log(avctx, AV_LOG_ERROR, "Unknown compression type %d\n", compr);