1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:27:46 +00:00

LibGfx: Bubble up allocation failure instead of panicking

This commit is contained in:
Lucas CHOLLET 2023-02-27 23:26:16 -05:00 committed by Sam Atkins
parent fc538bc00b
commit a139c77c71

View file

@ -1332,7 +1332,7 @@ static ErrorOr<Vector<Macroblock>> construct_macroblocks(JPEGLoadingContext& con
// This function handles the "Multi-scan" loop.
Vector<Macroblock> macroblocks;
macroblocks.resize(context.mblock_meta.padded_total);
TRY(macroblocks.try_resize(context.mblock_meta.padded_total));
Marker marker = TRY(read_marker_at_cursor(*context.stream));
while (true) {