X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdnxhddec.c;h=1e95086696703b390636f237a2d58ea32c014472;hb=2e254bb897471b4a4db2b846947fc6c00faac3e6;hp=ae8b0ffafa279e9c62e16097b38fab6ffad17c5c;hpb=762c2b5dcd99a08452299cd1f83070f88115f1f3;p=ffmpeg diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index ae8b0ffafa2..1e950866967 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -37,7 +37,7 @@ #include "thread.h" typedef struct RowContext { - DECLARE_ALIGNED(16, int16_t, blocks)[12][64]; + DECLARE_ALIGNED(32, int16_t, blocks)[12][64]; int luma_scale[64]; int chroma_scale[64]; GetBitContext gb; @@ -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);