MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / mp_get_code

Function mp_get_code

libavcodec/motionpixels.c:133–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133static 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
153static int mp_read_codes_table(MotionPixelsContext *mp, GetBitContext *gb)
154{

Callers 1

mp_read_codes_tableFunction · 0.85

Calls 2

get_bits1Function · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected