Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2014-09-26 15:29:59 +0400
committerHendrik Leppkes <h.leppkes@gmail.com>2014-09-26 15:29:59 +0400
commitf8ec837ec464e6424c95b11ac3982e28e0ec2c0c (patch)
tree587da87366189b6c68877a52eeeba67e7296e911 /decoder
parent7ef0fc0bfeaadac371cf9994c0f041e7d8aeca96 (diff)
Fail early when the renderer requests non-sense width values
Diffstat (limited to 'decoder')
-rw-r--r--decoder/LAVVideo/LAVVideo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp
index 9bb922d5..8abd20d2 100644
--- a/decoder/LAVVideo/LAVVideo.cpp
+++ b/decoder/LAVVideo/LAVVideo.cpp
@@ -1050,6 +1050,12 @@ receiveconnection:
CMediaType newmt = *pmt;
videoFormatTypeHandler(newmt.Format(), newmt.FormatType(), &pBIH);
DbgLog((LOG_TRACE, 10, L"-> New MediaType negotiated; actual width: %d - renderer requests: %ld", width, pBIH->biWidth));
+ if (pBIH->biWidth < width) {
+ DbgLog((LOG_ERROR, 10, L"-> Renderer requests width smaller than image width, failing.."));
+ DeleteMediaType(pmt);
+ pOut->Release();
+ return E_FAIL;
+ }
// Check image size
DWORD lSampleSize = m_PixFmtConverter.GetImageSize(pBIH->biWidth, abs(pBIH->biHeight));
if (lSampleSize != pBIH->biSizeImage) {