saucecontrol / PhotoSauce

MagicScaler high-performance, high-quality image processing pipeline for .NET
http://photosauce.net/
MIT License
569 stars 49 forks source link

Decoder FrameRange validation is not valid #151

Closed MaceWindu closed 4 months ago

MaceWindu commented 5 months ago

https://github.com/saucecontrol/PhotoSauce/blob/3a4f092c701b6f0990c1e8b388c535d06ac863e8/src/MagicScaler/Utilities/MiscExtensions.cs#L100

return (uint)start <= (uint)end && (uint)length <= (uint)end;

should be

return (uint)start <= (uint)end && (uint)length >= (uint)end;

Trying to extract first frame from multi-frame image and this check makes it impossible.

saucecontrol commented 5 months ago

Thanks, you're right. That was actually meant to be

return (uint)start <= (uint)end && (uint)end <= (uint)length;
saucecontrol commented 4 months ago

Fixed in https://github.com/saucecontrol/PhotoSauce/commit/62d101df3c76b2adfc95af289f84f3957f51e549