| 131 | } |
| 132 | |
| 133 | static int mp_get_code(MotionPixelsContext *mp, GetBitContext *gb, int size) |
| 134 | { |
| 135 | while (get_bits1(gb)) { |
| 136 | ++size; |
| 137 | if (size > mp->max_codes_bits) { |
| 138 | av_log(mp->avctx, AV_LOG_ERROR, "invalid code size %d/%d\n", size, mp->max_codes_bits); |
| 139 | return AVERROR_INVALIDDATA; |
| 140 | } |
| 141 | if (mp_get_code(mp, gb, size) < 0) |
| 142 | return AVERROR_INVALIDDATA; |
| 143 | } |
| 144 | if (mp->current_codes_count >= mp->codes_count) { |
| 145 | av_log(mp->avctx, AV_LOG_ERROR, "too many codes\n"); |
| 146 | return AVERROR_INVALIDDATA; |
| 147 | } |
| 148 | |
| 149 | mp->codes[mp->current_codes_count++].size = size; |
| 150 | return 0; |
| 151 | } |
| 152 | |
| 153 | static int mp_read_codes_table(MotionPixelsContext *mp, GetBitContext *gb) |
| 154 | { |
no test coverage detected