summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2018-12-03 19:44:49 +0100
committerPaul B Mahol <onemda@gmail.com>2018-12-03 19:44:49 +0100
commit5487560acfc48b783392e30e04347131f7d46a4f (patch)
tree27b3dd42c2d646fe988a1728778ebdfefc1c1d96 /libavcodec/dnxhddec.c
parentbe17a82f3cfb09174b668663ee3d194744fc9222 (diff)
downloadffmpeg-5487560acfc48b783392e30e04347131f7d46a4f.tar.gz
avcodec/dnxhddec: use init_get_bits8()
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index ae8b0ffafa..abda5c656d 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -589,12 +589,16 @@ static int dnxhd_decode_row(AVCodecContext *avctx, void *data,
const DNXHDContext *ctx = avctx->priv_data;
uint32_t offset = ctx->mb_scan_index[rownb];
RowContext *row = ctx->rows + threadnb;
- int x;
+ int x, ret;
row->last_dc[0] =
row->last_dc[1] =
row->last_dc[2] = 1 << (ctx->bit_depth + 2); // for levels +2^(bitdepth-1)
- init_get_bits(&row->gb, ctx->buf + offset, (ctx->buf_size - offset) << 3);
+ ret = init_get_bits8(&row->gb, ctx->buf + offset, ctx->buf_size - offset);
+ if (ret < 0) {
+ row->errors++;
+ return ret;
+ }
for (x = 0; x < ctx->mb_width; x++) {
//START_TIMER;
int ret = dnxhd_decode_macroblock(ctx, row, data, x, rownb);