mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Assert that size of image data matches size of video
Crash with assertion when the size of the graphics is different from the video currently being rendered, instead of causing weirder bugs and a corrupted video file.
This commit is contained in:
parent
a0465b67dd
commit
3a0e2429d1
|
@ -614,6 +614,8 @@ void CVideo::UpdateVideoBufferFromGraphics(size_t ThreadIndex)
|
|||
uint32_t Height;
|
||||
CImageInfo::EImageFormat Format;
|
||||
m_pGraphics->GetReadPresentedImageDataFuncUnsafe()(Width, Height, Format, m_vVideoBuffers[ThreadIndex].m_vBuffer);
|
||||
dbg_assert((int)Width == m_Width && (int)Height == m_Height, "Size mismatch between video and graphics");
|
||||
dbg_assert(Format == CImageInfo::FORMAT_RGBA, "Unexpected image format");
|
||||
}
|
||||
|
||||
AVFrame *CVideo::AllocPicture(enum AVPixelFormat PixFmt, int Width, int Height)
|
||||
|
|
Loading…
Reference in a new issue