77 #define HUFFMAN_TABLE_SIZE (64 * 1024)
116 if ((number == 0) || (number > 1024))
121 if ((number == 0) || (number > 1024))
126 if (sample_rate && (sample_rate < 8000 || sample_rate > 48000))
131 if (number > 2 || sample_rate && !number)
136 if (number > 2 || sample_rate && !number)
149 unsigned int sample_rate, bytes_per_sample, channels;
166 if (sample_rate > 0) {
167 if (sample_rate < 14 || sample_rate > INT_MAX) {
171 if (bytes_per_sample < 1 || bytes_per_sample > 2) {
176 if (channels < 1 || channels > 2) {
224 st->
codec->
bit_rate = sample_rate * bytes_per_sample * 8 * channels;
226 if (bytes_per_sample == 1)
231 if (sample_rate % 14 != 0) {
233 bytes_per_sample * channels;
235 bytes_per_sample * channels;
238 (sample_rate / 14) * bytes_per_sample * channels;
254 unsigned int chunk_size;
259 unsigned char r,
g,
b;
260 unsigned char palette_buffer[768];
270 }
else if (command == 1) {
272 ret =
avio_read(pb, palette_buffer, 768);
275 }
else if (ret != 768) {
281 for (i = 0; i < 768; i++)
282 if (palette_buffer[i] > 63) {
287 for (i = 0; i < 256; i++) {
288 r = palette_buffer[i * 3 ] << palette_scale;
289 g = palette_buffer[i * 3 + 1] << palette_scale;
290 b = palette_buffer[i * 3 + 2] << palette_scale;
291 palette[i] = (0xFF
U << 24) | (r << 16) | (g << 8) | (b);
292 if (palette_scale == 2)
293 palette[i] |= palette[i] >> 6 & 0x30303;
302 if (chunk_size < 4 || chunk_size > INT_MAX - 4) {
314 else if (ret != chunk_size) {
355 int64_t timestamp,
int flags)