diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-11 01:07:03 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-11 01:10:16 +0300 |
commit | c158ca6b67e257047dbafe141498926eeb025d70 (patch) | |
tree | 5b40e6799ea04c6ad647d3d7717a2cf18a456779 /decoder/LAVVideo | |
parent | ab8192d899d47859b059c62ed56abdf71bfb7fbc (diff) |
Protect against memory allocation of media samples failing
Diffstat (limited to 'decoder/LAVVideo')
-rw-r--r-- | decoder/LAVVideo/LAVVideo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp index e951dc92..b905a765 100644 --- a/decoder/LAVVideo/LAVVideo.cpp +++ b/decoder/LAVVideo/LAVVideo.cpp @@ -1768,7 +1768,8 @@ HRESULT CLAVVideo::DeliverToRenderer(LAVFrame *pFrame) ReconnectOutput(width, height, pFrame->aspect_ratio, pFrame->ext_format, avgDuration, TRUE); } else { - if(FAILED(hr = GetDeliveryBuffer(&pSampleOut, width, height, pFrame->aspect_ratio, pFrame->ext_format, avgDuration)) || FAILED(hr = pSampleOut->GetPointer(&pDataOut))) { + if(FAILED(hr = GetDeliveryBuffer(&pSampleOut, width, height, pFrame->aspect_ratio, pFrame->ext_format, avgDuration)) || FAILED(hr = pSampleOut->GetPointer(&pDataOut)) || pDataOut == nullptr) { + SafeRelease(&pSampleOut); ReleaseFrame(&pFrame); return hr; } |