Giter Club home page Giter Club logo

flac's Introduction

FLAC

Build Status

An implementation of FLAC, free lossless audio codec, written in Rust.

Documentation

Install

flac is on crates.io and can be included in your Cargo file like so:

[dependencies]

flac = "^0.5.0"

Followed by including it in you code:

extern crate flac;

Implementation Status

The status of this FLAC implementation:

Currently this project fully parses every FLAC file I've thrown at it and the decoder is working great for any file that has a bit sample size of 16 and before. This is based on the test suite I have on this project and the tests do fail when the bit sample size is larger than 16.

Now that I have the varied size integers, making the buffer allocation more efficient, I want to start on the encoding side of FLAC. It will be a bit slower as I am busy with work but that is a goal of the project for sure.

  • serialization
    • metadata
      • header
      • data
        • stream info
        • padding
        • application
        • seek table
        • vorbis comment
        • cuesheet
        • picture
        • unknown
    • frame
      • header
      • footer
      • sub-frame
        • header
        • constant
        • fixed
        • LPC
        • verbatim
  • encoder
    • frame
      • left side
      • right side
      • midpoint side
    • sub-frame
      • fixed
      • LPC

flac's People

Contributors

sourrust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flac's Issues

Owning version of the Stream Iterator

Hey there,

first of all thanks for providing the library :)

Now, I'm currently using my own fork (not yet pushed to GH though) due to the needs to having a iterator which owns the stream it is using internally. (The containing struct is wrapped in a box and Send off to a thread which feeds the decoded audio over a voice connection).

It would be great if a "owning" version of the stream iterator could be added by default. In case you're too busy, I can probably find some free time over the course of this weekend and clean up my fork so it's suitable for a PR.

Disabling Bounds Checking For Faster Decode/Encode

I notice that you are performing a lot of indexing throughout the application, but if you were to disable bounds checking for indexing you could gain a very large performance improvement. In example, you could take this section of code:

pub fn decode_left_side<S: Sample>(buffer: &mut [S]) {
  let block_size = buffer.len() / 2;

  for i in 0..block_size {
    let left = buffer[i];
    let side = buffer[i + block_size];

    // right channel
    buffer[i + block_size] = left - side;
  }
}

Then rewrite it with this using get_unchecked() to bypass the bounds checking and gain a sizeable performance improvements.

pub fn decode_left_side<S: Sample>(buffer: &mut [S]) {
  let block_size = buffer.len() / 2;

  for i in 0..block_size {
    buffer[i + block_size] = unsafe {
      let left = buffer.get_unchecked(i);
      let side = buffer.get_unchecked(i + block_size);
      left - side
    }
  }
}

per-frame / packet API

Hi what about a per-frame/per-packet API you can use together with custom, user provided containers like ogg or webm?

cargo future-incompatibilities warnings for v0.5.0

There are quite a lot of incompatibility warnings, but only of 2 distinct types:

$ cargo report future-incompatibilities --id 1 --package [email protected] | grep warning: | sort -u
>     = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
>    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
> warning: trailing semicolon in macro used in expression position

Infinite loop when building with Rust beta

Issue from a reddit commit that found flac would loop indefinitely on this file. I couldn't reproduce the infinite loop in stable versions of Rust on Mac OS X, so it is either beta and up of Rust or Linux that I need to test.

File: https://archive.org/download/unsorted_files/t.flac
Sample number: 49153
Operating System: GNU/Linux x86_64
Tested with: beta and nightly

index out of bounds panic when parsing bytes

extern crate flac;

use flac::{ByteStream, Stream};

fn main() {
    let s = Stream::<ByteStream>::from_buffer(b"fLaC\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00H\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\\");
    if let Ok(mut stream) = s {
        let _ = stream.info();
        let _ = stream.metadata();
        let mut iter = stream.iter::<i8>();
        while iter.next().is_some() { }
    }
}
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /root/.cargo/git/checkouts/flac-34fb57da42139a77/9549bf8/src/utility/macros.rs:9

Found via https://github.com/rust-fuzz/cargo-fuzz

Clippy Errors

You might find this useful

   Compiling flac v0.4.0 (file:///home/mmstick/Programming/flac)
src/subframe/types.rs:71:1: 76:2 warning: All variants have the same prefix: `Partitioned`, #[warn(enum_variant_names)] on by default
src/subframe/types.rs:71 pub enum CodingMethod {
                         ^
src/subframe/types.rs:71:1: 76:2 help: remove the prefixes and use full paths to the variants instead of glob imports
src/subframe/types.rs:71:1: 76:2 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#enum_variant_names
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/subframe/parser.rs:124:38: 91:32 note: in this expansion of take_bits! (defined in <nom macros>)
src/subframe/parser.rs:124:5: 124:69 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
src/subframe/parser.rs:123:19: 125:4 note: in this expansion of try_parser! (defined in src/utility/macros.rs)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
<nom macros>:2:29: 5:42 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/subframe/parser.rs:163:8: 91:32 note: in this expansion of map! (defined in <nom macros>)
src/subframe/parser.rs:162:3: 164:20 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:178:36: 43:41 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:178:18: 7:42 note: in this expansion of count_slice! (defined in src/utility/macros.rs)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:177:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:176:3: 190:17 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/subframe/parser.rs:197:51: 2:42 note: in this expansion of take_bits! (defined in <nom macros>)
src/subframe/parser.rs:197:24: 197:60 note: in this expansion of try_parse! (defined in <nom macros>)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:218:36: 43:41 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:218:18: 7:42 note: in this expansion of count_slice! (defined in src/utility/macros.rs)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:217:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:216:3: 239:15 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/subframe/parser.rs:221:43: 43:42 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:38:1: 39:63 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:14:1: 17:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:217:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:216:3: 239:15 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:223:25: 43:41 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:222:18: 7:42 note: in this expansion of count_slice! (defined in src/utility/macros.rs)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:38:1: 39:63 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:14:1: 17:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:217:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:216:3: 239:15 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:246:38: 8:27 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
<nom macros>:2:29: 5:42 note: in this expansion of count! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/subframe/parser.rs:246:3: 247:33 note: in this expansion of map! (defined in <nom macros>)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/subframe/parser.rs:254:48: 2:42 note: in this expansion of take_bits! (defined in <nom macros>)
src/subframe/parser.rs:254:21: 254:57 note: in this expansion of try_parse! (defined in <nom macros>)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<nom macros>:6:49: 53:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:17:1: 20:47 note: in this expansion of tuple_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:58 note: in this expansion of tuple_parser! (defined in <nom macros>)
<nom macros>:5:1: 6:72 note: in this expansion of tuple! (defined in <nom macros>)
<nom macros>:10:1: 10:64 note: in this expansion of pair! (defined in <nom macros>)
src/subframe/parser.rs:271:25: 2:42 note: in this expansion of pair! (defined in <nom macros>)
src/subframe/parser.rs:270:19: 271:62 note: in this expansion of try_parse! (defined in <nom macros>)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/subframe/parser.rs:312:32: 43:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:311:18: 320:6 note: in this expansion of chain! (defined in <nom macros>)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/subframe/parser.rs:313:59: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
src/subframe/parser.rs:313:17: 43:42 note: in this expansion of cond! (defined in <nom macros>)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:311:18: 320:6 note: in this expansion of chain! (defined in <nom macros>)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:374:11: 374:56 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
<nom macros>:19:8: 19:41 warning: operator precedence can trip the unwary. Consider parenthesizing your expression:`val << (remaining - ( 8 - offset ))`, #[warn(precedence)] on by default
<nom macros>:19 acc += val << remaining - ( 8 - offset ) ; remaining -= 8 - offset ; offset =
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/subframe/parser.rs:418:27: 141:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:38:1: 39:63 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:415:18: 423:9 note: in this expansion of chain! (defined in <nom macros>)
<nom macros>:19:8: 19:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#precedence
src/metadata/types.rs:660:39: 660:44 warning: you should put `ID3v2` between ticks in the documentation, #[warn(doc_markdown)] on by default
src/metadata/types.rs:660 /// The picture type according to the ID3v2 attached picture frame.
                                                                ^~~~~
src/metadata/types.rs:660:39: 660:44 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#doc_markdown
src/utility/types.rs:373:20: 373:27 warning: this expression borrows a reference that is immediately dereferenced by the compiler, #[warn(needless_borrow)] on by default
src/utility/types.rs:373       from_iresult(&buffer, iresult)
                                            ^~~~~~~
src/utility/types.rs:373:20: 373:27 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrow
src/frame/parser.rs:44:9: 44:60 warning: The function/method "len" doesn't need a mutable reference, #[warn(unnecessary_mut_passed)] on by default
src/frame/parser.rs:44         &mut subframes[0..(frame_header.channels as usize)]
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<nom macros>:2:30: 3:75 note: in this expansion of count_slice! (defined in src/utility/macros.rs)
<nom macros>:2:1: 2:52 note: in this expansion of bits_impl! (defined in <nom macros>)
src/frame/parser.rs:41:9: 7:42 note: in this expansion of bits! (defined in <nom macros>)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/frame/parser.rs:39:16: 55:4 note: in this expansion of chain! (defined in <nom macros>)
src/frame/parser.rs:44:9: 44:60 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#unnecessary_mut_passed
src/frame/parser.rs:190:3: 199:4 warning: the loop variable `i` is only used to index `bytes`. Consider using `for item in bytes.iter().take(size)` or similar iterators, #[warn(needless_range_loop)] on by default
src/frame/parser.rs:190   for i in 0..size {
                          ^
src/frame/parser.rs:190:3: 199:4 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/frame/decoder.rs:11:3: 17:4 warning: the loop variable `i` is used to index `buffer`. Consider using `for (i, item) in buffer.iter().enumerate().take(block_size)` or similar iterators, #[warn(needless_range_loop)] on by default
src/frame/decoder.rs:11   for i in 0..block_size {
                          ^
src/frame/decoder.rs:11:3: 17:4 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/frame/decoder.rs:27:3: 33:4 warning: the loop variable `i` is used to index `buffer`. Consider using `for (i, item) in buffer.iter().enumerate().take(block_size)` or similar iterators, #[warn(needless_range_loop)] on by default
src/frame/decoder.rs:27   for i in 0..block_size {
                          ^
src/frame/decoder.rs:27:3: 33:4 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/frame/decoder.rs:43:3: 52:4 warning: the loop variable `i` is used to index `buffer`. Consider using `for (i, item) in buffer.iter().enumerate().take(block_size)` or similar iterators, #[warn(needless_range_loop)] on by default
src/frame/decoder.rs:43   for i in 0..block_size {
                          ^
src/frame/decoder.rs:43:3: 52:4 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/subframe/parser.rs:19:3: 41:4 warning: the loop variable `i` is used to index `bytes`. Consider using `for (i, item) in bytes.iter().enumerate().take(bytes_len)` or similar iterators, #[warn(needless_range_loop)] on by default
src/subframe/parser.rs:19   for i in 0..bytes_len {
                            ^
src/subframe/parser.rs:19:3: 41:4 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
src/subframe/parser.rs:124:38: 91:32 note: in this expansion of take_bits! (defined in <nom macros>)
src/subframe/parser.rs:124:5: 124:69 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
src/subframe/parser.rs:123:19: 125:4 note: in this expansion of try_parser! (defined in src/utility/macros.rs)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
<nom macros>:2:29: 5:42 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/subframe/parser.rs:163:8: 91:32 note: in this expansion of map! (defined in <nom macros>)
src/subframe/parser.rs:162:3: 164:20 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:178:36: 43:41 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:178:18: 7:42 note: in this expansion of count_slice! (defined in src/utility/macros.rs)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:177:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:176:3: 190:17 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/subframe/parser.rs:179:20: 179:41 warning: The function/method "len" doesn't need a mutable reference, #[warn(unnecessary_mut_passed)] on by default
src/subframe/parser.rs:179                    &mut warmup[0..order]) ~
                                              ^~~~~~~~~~~~~~~~~~~~~
src/subframe/parser.rs:178:18: 7:42 note: in this expansion of count_slice! (defined in src/utility/macros.rs)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:177:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:176:3: 190:17 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
src/subframe/parser.rs:179:20: 179:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#unnecessary_mut_passed
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
src/subframe/parser.rs:197:51: 2:42 note: in this expansion of take_bits! (defined in <nom macros>)
src/subframe/parser.rs:197:24: 197:60 note: in this expansion of try_parse! (defined in <nom macros>)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/subframe/parser.rs:206:1: 240:2 warning: the function has a cyclomatic complexity of 35, #[warn(cyclomatic_complexity)] on by default
src/subframe/parser.rs:206 pub fn lpc<'a, S>(input: (&'a [u8], usize),
                           ^
src/subframe/parser.rs:206:1: 240:2 help: you could split it up into multiple smaller functions
src/subframe/parser.rs:206:1: 240:2 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#cyclomatic_complexity
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:218:36: 43:41 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:218:18: 7:42 note: in this expansion of count_slice! (defined in src/utility/macros.rs)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:217:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:216:3: 239:15 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/subframe/parser.rs:219:20: 219:41 warning: The function/method "len" doesn't need a mutable reference, #[warn(unnecessary_mut_passed)] on by default
src/subframe/parser.rs:219                    &mut warmup[0..order]) ~
                                              ^~~~~~~~~~~~~~~~~~~~~
src/subframe/parser.rs:218:18: 7:42 note: in this expansion of count_slice! (defined in src/utility/macros.rs)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:217:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:216:3: 239:15 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
src/subframe/parser.rs:219:20: 219:41 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#unnecessary_mut_passed
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/subframe/parser.rs:221:43: 43:42 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:38:1: 39:63 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:14:1: 17:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:217:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:216:3: 239:15 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:223:25: 43:41 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:222:18: 7:42 note: in this expansion of count_slice! (defined in src/utility/macros.rs)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:38:1: 39:63 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:14:1: 17:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:217:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:216:3: 239:15 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/subframe/parser.rs:224:9: 224:40 warning: The function/method "len" doesn't need a mutable reference, #[warn(unnecessary_mut_passed)] on by default
src/subframe/parser.rs:224         &mut qlp_coefficients[0..order]
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/subframe/parser.rs:222:18: 7:42 note: in this expansion of count_slice! (defined in src/utility/macros.rs)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:38:1: 39:63 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:14:1: 17:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:217:10: 91:32 note: in this expansion of chain! (defined in <nom macros>)
src/subframe/parser.rs:216:3: 239:15 note: in this expansion of to_custom_error! (defined in src/utility/macros.rs)
src/subframe/parser.rs:224:9: 224:40 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#unnecessary_mut_passed
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:246:38: 8:27 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
<nom macros>:2:29: 5:42 note: in this expansion of count! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/subframe/parser.rs:246:3: 247:33 note: in this expansion of map! (defined in <nom macros>)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
src/subframe/parser.rs:254:48: 2:42 note: in this expansion of take_bits! (defined in <nom macros>)
src/subframe/parser.rs:254:21: 254:57 note: in this expansion of try_parse! (defined in <nom macros>)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
<nom macros>:6:49: 53:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:17:1: 20:47 note: in this expansion of tuple_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:58 note: in this expansion of tuple_parser! (defined in <nom macros>)
<nom macros>:5:1: 6:72 note: in this expansion of tuple! (defined in <nom macros>)
<nom macros>:10:1: 10:64 note: in this expansion of pair! (defined in <nom macros>)
src/subframe/parser.rs:271:25: 2:42 note: in this expansion of pair! (defined in <nom macros>)
src/subframe/parser.rs:270:19: 271:62 note: in this expansion of try_parse! (defined in <nom macros>)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
src/subframe/parser.rs:312:32: 43:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:311:18: 320:6 note: in this expansion of chain! (defined in <nom macros>)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
src/subframe/parser.rs:313:59: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
src/subframe/parser.rs:313:17: 43:42 note: in this expansion of cond! (defined in <nom macros>)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:311:18: 320:6 note: in this expansion of chain! (defined in <nom macros>)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
<nom macros>:2:29: 5:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:2:1: 2:68 note: in this expansion of map_impl! (defined in <nom macros>)
src/utility/macros.rs:78:5: 80:7 note: in this expansion of map! (defined in <nom macros>)
src/utility/macros.rs:83:5: 83:43 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
src/subframe/parser.rs:374:11: 374:56 note: in this expansion of take_signed_bits! (defined in src/utility/macros.rs)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
<nom macros>:11:64: 20:8 warning: the loop variable `it` is only used to index `input`. Consider using `for item in input.iter().take(cnt + 1)` or similar iterators, #[warn(needless_range_loop)] on by default
<nom macros>:11 remaining : usize = $ count ; let mut end_offset : usize = 0 ; for it in 0 ..
                                                                               ^
src/subframe/parser.rs:418:27: 141:42 note: in this expansion of take_bits! (defined in <nom macros>)
<nom macros>:50:19: 53:39 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:38:1: 39:63 note: in this expansion of chaining_parser! (defined in <nom macros>)
<nom macros>:2:3: 2:54 note: in this expansion of chaining_parser! (defined in <nom macros>)
src/subframe/parser.rs:415:18: 423:9 note: in this expansion of chain! (defined in <nom macros>)
<nom macros>:11:64: 20:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/subframe/decoder.rs:93:7: 95:8 warning: the loop variable `i` is only used to index `output`. Consider using `for item in &output` or similar iterators, #[warn(needless_range_loop)] on by default
src/subframe/decoder.rs:93       for i in 0..output.len() {
                                 ^
src/subframe/decoder.rs:93:7: 95:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/subframe/decoder.rs:105:7: 109:8 warning: the loop variable `i` is used to index `output`. Consider using `for (i, item) in output.iter().enumerate().take(order)` or similar iterators, #[warn(needless_range_loop)] on by default
src/subframe/decoder.rs:105       for i in 0..order {
                                  ^
src/subframe/decoder.rs:105:7: 109:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/subframe/decoder.rs:117:7: 121:8 warning: the loop variable `i` is used to index `output`. Consider using `for (i, item) in output.iter().enumerate().take(order)` or similar iterators, #[warn(needless_range_loop)] on by default
src/subframe/decoder.rs:117       for i in 0..order {
                                  ^
src/subframe/decoder.rs:117:7: 121:8 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop
src/metadata/types.rs:141:13: 141:27 warning: unused import, #[warn(unused_imports)] on by default
src/metadata/types.rs:141         use std::io::Write;
                                      ^~~~~~~~~~~~~~
src/metadata/types.rs:212:13: 212:27 warning: unused import, #[warn(unused_imports)] on by default
src/metadata/types.rs:212         use std::io::Write;
                                      ^~~~~~~~~~~~~~
src/metadata/types.rs:277:3: 289:4 warning: you should consider deriving a `Default` implementation for `metadata::types::StreamInfo`, #[warn(new_without_default_derive)] on by default
src/metadata/types.rs:277   pub fn new() -> StreamInfo {
                            ^
src/metadata/types.rs:277:3: 289:4 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive
src/metadata/types.rs:277:3: 289:4 help: try this
src/metadata/types.rs:      #[derive(Default)]
src/metadata/metadata.rs:264:1: 307:2 warning: this function has too many arguments (8/7), #[warn(too_many_arguments)] on by default
src/metadata/metadata.rs:264 pub fn get_picture(filename: &str,
                             ^
src/metadata/metadata.rs:264:1: 307:2 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#too_many_arguments
src/stream.rs:159:39: 159:50 warning: this `match` has identical arm bodies, #[warn(match_same_arms)] on by default
src/stream.rs:159         Err(_)                     => return None,
                                                        ^~~~~~~~~~~
src/stream.rs:157:39: 157:50 note: same as this
src/stream.rs:157         Err(ErrorKind::EndOfInput) => return None,
                                                        ^~~~~~~~~~~
src/stream.rs:159:39: 159:50 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#match_same_arms
src/stream.rs:143:11: 151:12 warning: the variable `channel` is used as a loop counter. Consider using `for (channel, item) in &frame.subframes[0..channels].enumerate()` or similar iterators, #[warn(explicit_counter_loop)] on by default
src/stream.rs:143           for subframe in &frame.subframes[0..channels] {
                            ^
src/stream.rs:143:11: 151:12 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#explicit_counter_loop
src/stream.rs:148:30: 148:39 warning: this expression borrows a reference that is immediately dereferenced by the compiler, #[warn(needless_borrow)] on by default
src/stream.rs:148             subframe::decode(&subframe, block_size, output);
                                               ^~~~~~~~~
src/stream.rs:148:30: 148:39 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrow

Out of memory error when parsing bytes

extern crate flac;

use std::io::{self, Read, Cursor};
use flac::{ByteStream, Stream};

fn main() {
    let input = b"\x66\x4c\x61\x43\x04\x30\x30\x30\x00\x00\x00\x00\x30\x30\x30\x30";
    let s = Stream::<ByteStream>::from_buffer(input);
    if let Ok(mut stream) = s {
        let _ = stream.info();
        let _ = stream.metadata();
        let mut iter = stream.iter();
        while iter.next().is_some() {
        }
    }
}
coreyf@aflstagingmachine ~/afl-flac-staging-area> cargo run --verbose
       Fresh strsim v0.3.0
       Fresh libc v0.2.5
       Fresh regex-syntax v0.2.2
       Fresh nom v1.1.0
       Fresh rustc-serialize v0.3.16
       Fresh gcc v0.3.21
       Fresh memchr v0.1.7
       Fresh hound v1.1.0
       Fresh afl-coverage-plugin v0.0.1 (file:///home/coreyf/afl-flac-staging-area)
       Fresh aho-corasick v0.4.0
       Fresh regex v0.1.48
       Fresh afl-coverage v0.0.1 (file:///home/coreyf/afl-flac-staging-area)
       Fresh docopt v0.6.78
       Fresh flac v0.1.0
       Fresh afl-staging-area v0.1.0 (file:///home/coreyf/afl-flac-staging-area)
     Running `target/debug/afl-staging-area`
fatal runtime error: out of memory
Process didn't exit successfully: `target/debug/afl-staging-area` (signal: 4)

Found using afl.rs โœจ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.