History

fix frame size constraints for width and height

unknown committed 10 years ago

Commit 3873add1 parent 10308206 files · +33 −18Browse files

Showing the changes to codec/processing/src/common/WelsFrameWork.cpp (1 of 6 files). Show all

Unified · Split

codec/processing/src/common/WelsFrameWork.cpp+4−4
@@ -233,16 +233,16 @@ bool CVpFrameWork::CheckValid (EMethods eMethod, SPixMap& pSrcPixMap, SPixMap& · 232 unmodified lines
233233 }
234234
235235 if (pSrcPixMap.pPixel[0]) {
236− if (pSrcPixMap.sRect.iRectWidth <= 0 || pSrcPixMap.sRect.iRectWidth > MAX_WIDTH || pSrcPixMap.sRect.iRectHeight <= 0
237− || pSrcPixMap.sRect.iRectHeight > MAX_HEIGHT)
236+ if (pSrcPixMap.sRect.iRectWidth <= 0 || pSrcPixMap.sRect.iRectHeight <= 0
237+ || pSrcPixMap.sRect.iRectWidth * pSrcPixMap.sRect.iRectHeight > (MAX_MBS_PER_FRAME << 8))
238238 goto exit;
239239 if (pSrcPixMap.sRect.iRectTop >= pSrcPixMap.sRect.iRectHeight
240240 || pSrcPixMap.sRect.iRectLeft >= pSrcPixMap.sRect.iRectWidth || pSrcPixMap.sRect.iRectWidth > pSrcPixMap.iStride[0])
241241 goto exit;
242242 }
243243 if (pDstPixMap.pPixel[0]) {
244− if (pDstPixMap.sRect.iRectWidth <= 0 || pDstPixMap.sRect.iRectWidth > MAX_WIDTH || pDstPixMap.sRect.iRectHeight <= 0
245− || pDstPixMap.sRect.iRectHeight > MAX_HEIGHT)
244+ if (pDstPixMap.sRect.iRectWidth <= 0 || pDstPixMap.sRect.iRectHeight <= 0
245+ || pDstPixMap.sRect.iRectWidth * pDstPixMap.sRect.iRectHeight > (MAX_MBS_PER_FRAME << 8))
246246 goto exit;
247247 if (pDstPixMap.sRect.iRectTop >= pDstPixMap.sRect.iRectHeight
248248 || pDstPixMap.sRect.iRectLeft >= pDstPixMap.sRect.iRectWidth || pDstPixMap.sRect.iRectWidth > pDstPixMap.iStride[0])

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t