Serial-ATA / lofty-rs

Audio metadata library
Apache License 2.0
185 stars 34 forks source link

misc: Add allocation limit to `try_vec!` #207

Closed Serial-ATA closed 1 year ago

Serial-ATA commented 1 year ago

This adds an arbitrary allocation limit of 8MB for any one item, which should be more than enough in any case.

This was changed to stop the fuzz tests from failing with OOM errors.

hinto-janai commented 1 year ago

Does this include Picture's?

I'm sure I have some audio files with enormous embedded images (although probably not >8MB...?)

I'll scan all of them and report back.

Serial-ATA commented 1 year ago

Yeah, this includes pictures as well. I haven't encountered any image >8MB in my experience.

hinto-janai commented 1 year ago

I have a few that are 5.1 MB. Is there a downside to increasing the limit to just before the fuzz tests start failing?

Serial-ATA commented 1 year ago

The fuzz tests would OOM at different points depending on the system.

I think 8MB is probably a safe size. Having a single tag item >8MB seems a little crazy to me. Unless there's something I'm not thinking of.

Do note that the limit is arbitrary, it can always be increased later if it becomes an issue.

hinto-janai commented 1 year ago

Ok, sounds good.

Serial-ATA commented 1 year ago

Actually, it wouldn't hurt to make this configurable in ParseOptions eventually. I'll make an issue for that.