exeldro / obs-shaderfilter

OBS Studio filter for applying an arbitrary shader to a source.
GNU General Public License v2.0
377 stars 39 forks source link

Buffer overflow in string parameters with escaped characters #34

Open shole opened 8 months ago

shole commented 8 months ago

If string variable contains escaped characters, such as \", both are counted but only the " is printed, resulting in UI printing past actual string variable

Reproduction example below;

uniform string infooverflow<
    string widget_type = "info";
> = "here's some escaped \" characters: \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\" and some more text";
uniform string stringoverflow="also works with straight string \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"";
float4 mainImage(VertData v_in) : TARGET {
    return image.Sample(textureSampler, v_in.uv);
}

Looks like this in OBS https://i.imgur.com/Hc7CVqU.png

exeldro commented 8 months ago

That looks to be a bug in OBS, not in the plugin. Let me see if I can make a fix for it.