mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-20 13:36:41 +00:00
Handle thumbnails of 0 width or height without crashing
This commit is contained in:
@@ -966,6 +966,12 @@ bool RenderDoc::ShouldTriggerCapture(uint32_t frameNumber)
|
||||
|
||||
void RenderDoc::ResamplePixels(const FramePixels &in, RDCThumb &out)
|
||||
{
|
||||
if(in.width == 0 || in.height == 0)
|
||||
{
|
||||
out = RDCThumb();
|
||||
return;
|
||||
}
|
||||
|
||||
// code below assumes pitch_requirement is a power of 2 number
|
||||
RDCASSERT((in.pitch_requirement & (in.pitch_requirement - 1)) == 0);
|
||||
|
||||
@@ -1076,6 +1082,12 @@ void RenderDoc::ResamplePixels(const FramePixels &in, RDCThumb &out)
|
||||
}
|
||||
void RenderDoc::EncodePixelsPNG(const RDCThumb &in, RDCThumb &out)
|
||||
{
|
||||
if(in.width == 0 || in.height == 0)
|
||||
{
|
||||
out = RDCThumb();
|
||||
return;
|
||||
}
|
||||
|
||||
struct WriteCallbackData
|
||||
{
|
||||
std::vector<byte> buffer;
|
||||
|
||||
Reference in New Issue
Block a user