diff options
author | Michael Niedermayer | 2011-12-08 13:50:25 +0100 |
---|---|---|
committer | Michael Niedermayer | 2011-12-08 18:31:32 +0100 |
commit | bef8dfa0568a0c8207c440fd90c8a66c1772bd1f (patch) | |
tree | 75e1b8a2e81432750527c149c282555ed56fd857 /libavcodec/escape130.c | |
parent | f7da12350ea82ad7193bc593b83b38607a8f4c40 (diff) |
escape130: replace can_safely_read() by get_bits_left()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/escape130.c')
-rw-r--r-- | libavcodec/escape130.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c index be5327cf3a..5adfefa88d 100644 --- a/libavcodec/escape130.c +++ b/libavcodec/escape130.c @@ -29,10 +29,6 @@ typedef struct Escape130Context { uint8_t *bases; } Escape130Context; -static int can_safely_read(GetBitContext* gb, int bits) { - return get_bits_count(gb) + bits <= gb->size_in_bits; -} - /** * Initialize the decoder * @param avctx decoder context @@ -69,7 +65,7 @@ static unsigned decode_skip_count(GetBitContext* gb) { unsigned value; // This function reads a maximum of 27 bits, // which is within the padding space - if (!can_safely_read(gb, 1+3)) + if (get_bits_left(gb) < 1+3) return -1; value = get_bits1(gb); @@ -126,7 +122,7 @@ static int escape130_decode_frame(AVCodecContext *avctx, init_get_bits(&gb, buf, buf_size * 8); - if (!can_safely_read(&gb, 128)) + if (get_bits_left(&gb) < 128) return -1; // Header; no useful information in here |