fixed a crash with too large band

This commit is contained in:
Zeno Rogue 2024-02-22 18:41:52 +01:00
parent e33f26d51f
commit 8af2a43f5e
1 changed files with 11 additions and 1 deletions

View File

@ -457,6 +457,11 @@ EX namespace history {
dynamicval<bool> di(inHighQual, true);
renderbuffer glbuf(bandfull, bandfull, vid.usingGL);
glbuf.make_surface(); if(!glbuf.srf) {
addMessage(XLAT("Could not create an image of that size."));
return;
}
vid.xres = vid.yres = bandfull;
glbuf.enable(); current_display->radius = bandhalf;
calcparam();
@ -480,7 +485,8 @@ EX namespace history {
};
if(!band) {
addMessage("Could not create an image of that size.");
addMessage(XLAT("Could not create an image of that size."));
return;
}
else {
@ -528,6 +534,10 @@ EX namespace history {
len -= bandsegment; xpos -= bandsegment;
seglen = min(int(len), bandsegment);
band = SDL_CreateRGBSurface(SDL_SWSURFACE, seglen, bandfull,32,0,0,0,0);
if(!band) {
addMessage(XLAT("Could not create an image of that size."));
return;
}
goto drawsegment;
}
xpos += bwidth;