{"id":1718,"date":"2016-09-26T15:51:16","date_gmt":"2016-09-26T13:51:16","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1718"},"modified":"2016-09-24T19:19:38","modified_gmt":"2016-09-24T17:19:38","slug":"small-correction-for-directshow-baseclasses-ctransinplacefiltercopy","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1718","title":{"rendered":"Small correction for DirectShow BaseClasses CTransInPlaceFilter::Copy"},"content":{"rendered":"<p>False assertion failure in DirectShow BaseClasses <a href=\"https:\/\/github.com\/changman\/GMFBridge\/blob\/a75e264dd7bf064f101529f7382a81739b9c459b\/BaseClasses\/transip.cpp#L550\">transip.cpp, in <code>CTransInPlaceFilter::Copy<\/code><\/a>:<\/p>\n<pre><code>ASSERT(lDestSize &gt;= lSourceSize &amp;&amp; lDestSize &gt;= lDataLength);\r\n[...]\r\nCopyMemory((PVOID) pDestBuffer, (PVOID) pSourceBuffer, lDataLength);\r\n<\/code><\/pre>\n<p>The code asserts on &#8220;lDestSize &gt;= lSourceSize&#8221; which is true in most cases, but it does not have or need to be true. The code below copies just <code>lDataLength<\/code> bytes and assertion on buffer sizes is, generally, excessive. Valid scenarios do exist with this assertion popping up for no reason.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>False assertion failure in DirectShow BaseClasses transip.cpp, in CTransInPlaceFilter::Copy: ASSERT(lDestSize &gt;= lSourceSize &amp;&amp; lDestSize &gt;= lDataLength); [&#8230;] CopyMemory((PVOID) pDestBuffer, (PVOID) pSourceBuffer, lDataLength); The code asserts on &#8220;lDestSize &gt;= lSourceSize&#8221; which is true in most cases, but it does not have or need to be true. The code below copies just lDataLength bytes and assertion on&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1718\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[535,38,78],"class_list":["post-1718","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-baseclasses","tag-c","tag-directshow"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=1718"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1718\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}