diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-02-14 14:21:30 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-02-14 19:45:23 +0000 |
commit | 088dfd3ff15eba342863c74be53f7ca614957966 (patch) | |
tree | be7d4c11cc1b585826a4f8d80a43492cc0522a5b /libavcodec | |
parent | 4177f501b433a59edcdb8368f02082514f55f580 (diff) | |
download | ffmpeg-088dfd3ff15eba342863c74be53f7ca614957966.tar.gz |
avcodec/dxtory: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dxtory.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c index 91d87f08d9..22e7b2f4eb 100644 --- a/libavcodec/dxtory.c +++ b/libavcodec/dxtory.c @@ -285,7 +285,8 @@ static int dxtory_decode_v2_565(AVCodecContext *avctx, AVFrame *pic, "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n", AV_RL32(src + off), slice_size - 16); } - init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8); + if ((ret = init_get_bits8(&gb2, src + off + 16, slice_size - 16)) < 0) + return ret; dx2_decode_slice_565(&gb2, avctx->width, slice_height, dst, pic->linesize[0], is_565); @@ -367,7 +368,8 @@ static int dxtory_decode_v2_rgb(AVCodecContext *avctx, AVFrame *pic, "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n", AV_RL32(src + off), slice_size - 16); } - init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8); + if ((ret = init_get_bits8(&gb2, src + off + 16, slice_size - 16)) < 0) + return ret; dx2_decode_slice_rgb(&gb2, avctx->width, slice_height, dst, pic->linesize[0]); @@ -464,7 +466,8 @@ static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic, "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n", AV_RL32(src + off), slice_size - 16); } - init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8); + if ((ret = init_get_bits8(&gb2, src + off + 16, slice_size - 16)) < 0) + return ret; dx2_decode_slice_410(&gb2, avctx->width, slice_height, Y, U, V, pic->linesize[0], pic->linesize[1], pic->linesize[2]); @@ -566,7 +569,8 @@ static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic, "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n", AV_RL32(src + off), slice_size - 16); } - init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8); + if ((ret = init_get_bits8(&gb2, src + off + 16, slice_size - 16)) < 0) + return ret; dx2_decode_slice_420(&gb2, avctx->width, slice_height, Y, U, V, pic->linesize[0], pic->linesize[1], pic->linesize[2]); @@ -658,7 +662,8 @@ static int dxtory_decode_v2_444(AVCodecContext *avctx, AVFrame *pic, "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n", AV_RL32(src + off), slice_size - 16); } - init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8); + if ((ret = init_get_bits8(&gb2, src + off + 16, slice_size - 16)) < 0) + return ret; dx2_decode_slice_444(&gb2, avctx->width, slice_height, Y, U, V, pic->linesize[0], pic->linesize[1], pic->linesize[2]); |