summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-02-10Fix -Wformat-nonliteral warningsHEADmasterMarc-André Lureau3-48/+60
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10Fix void* casting warningsMarc-André Lureau3-29/+30
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10Fix -Wswitch-defaultMarc-André Lureau3-11/+38
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10util: remove redundant declarationMarc-André Lureau1-3/+0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10build-sys: remove unused directoriesMarc-André Lureau1-4/+0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: remove double declaration of function.Dave Airlie1-1/+1
2016-02-10tests: make some functions static.Dave Airlie4-7/+7
2016-02-10vtest: make some functions static.Dave Airlie1-2/+2
These functions are only used here. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-02-10vtest: fix shadowed variable usage.Dave Airlie1-2/+2
Call the input a different name. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-02-10renderer: fix a couple of shadowed variable declarations.Dave Airlie2-5/+5
This fixes a couple of -Wshadow warnings. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-02-10renderer: make some char * into const char *.Dave Airlie2-7/+7
This fixes a bunch of warnings about losing constness. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-02-10vtest: fix potential leakMarc-André Lureau1-3/+1
Found that to american fuzzy lop & AddressSanitizer Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10decode: check streamout-targets num_handlesMarc-André Lureau1-0/+3
Prevent out-of-bound array access. Found thanks to AddressSanitizer & american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10decode: check the buffer length before accessMarc-André Lureau1-33/+39
Avoid out of bounds array access. Found thanks to AddressSanitizer & american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10vtest: be reasonable about cmd lengthMarc-André Lureau1-0/+4
Avoid overflow, found thanks to AddressSanitizer & american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: unref index buffer when destroying sub contextMarc-André Lureau1-0/+2
Found thanks to AddressSanitizer. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: switch to context 0 before destroy subMarc-André Lureau1-0/+5
If the current context is one of the subcontext to be destroyed, vrend_destroy_sub_context() will fail after the last context is destroyed. Found thanks to amaerican fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: fix leak in hashtable on replaceMarc-André Lureau4-42/+25
Some american fuzzy lop tests managed to replace resources, however the old values got leaked (I am not sure if this should be allowed) In all cases, introduce a destroy callback to the hashtable, used when a value is removed, replaced or the table is cleared. This simplifies a bit resource management and help avoid potential errors by using simply refcounts. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: unref resource when destroying hashtable elementMarc-André Lureau1-1/+3
Resources are reference-counted, if another object holds a reference to a resource, it should not free it. Change the resource hashtable destroy callback to unref. Currently, this doesn't happen, since the resource hashtable is kept until the renderer is reset. However, in the next commit, the destroy callback will be used if a resource is replaced in the hashtable, and we want to keep the original resource. Furthermore, even if replace shouldn't happen, it avoids confusion and future errors if use only reference-counting mechanism. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: fix potential leaks in vrend_create_shaderMarc-André Lureau1-13/+26
Found thanks to llvm scan-build. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: check create_shader() finishedMarc-André Lureau1-0/+5
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: fix sampler views leaksMarc-André Lureau1-1/+5
Fix found thanks to AddressSanitizer. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: fix subcontext surface leaksMarc-André Lureau1-0/+9
Fix leaks found thanks to AddressSanitizer. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: tinitial abs_s1 value is never readMarc-André Lureau1-3/+2
Found thanks to llvm scan-build. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10decode: fix set_scissor_state boundsMarc-André Lureau3-5/+5
Do not accept negative values for num & start. Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10decode: check set_uniform_buffer argumentsMarc-André Lureau1-0/+7
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10decode: check set_sampler_views argsMarc-André Lureau1-0/+8
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: check box boundsMarc-André Lureau1-1/+2
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: validate descMarc-André Lureau1-0/+4
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: over-allocate shader bufferMarc-André Lureau1-2/+2
Since the memcpy() is done over multiple of 4 bytes, over-allocate the destination buffer to fit multiple of 4 shader length. Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: check shader continuation fitsMarc-André Lureau1-0/+7
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: prevent out of bound vps accessMarc-André Lureau3-4/+10
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: avoid out of bound sampler array accessMarc-André Lureau1-0/+6
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: validate shader_type valueMarc-André Lureau2-0/+8
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10vtest: ensure name is ending with 0Marc-André Lureau1-1/+1
Always nice to have. Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10vtest: fix simple potential leaksMarc-André Lureau1-2/+4
Found thanks to llvm scan-build. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10vtest: fix some leaks on errorMarc-André Lureau1-2/+4
Found thanks to llvm scan-build. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10vtest: allow to save/replay testsMarc-André Lureau3-35/+86
This is useful to do some quite accurate comparative benchmarks/profiling, and to run fuzzers, such as american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10decode: validate shader typeMarc-André Lureau1-0/+4
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: reject large LOD valuesMarc-André Lureau1-0/+2
Or we could sit for a very long time in some further loops. Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: report error on invalid surfaceMarc-André Lureau1-1/+4
Instead of later crashing. Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: validate scissor state indexMarc-André Lureau1-0/+11
Check the the index is < PIPE_MAX_VIEWPORTS. Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10decode: check we don't reach MAX_VIEWPORTSMarc-André Lureau1-2/+4
Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: avoid crash in vrend_destroy_shader_selector()Marc-André Lureau1-2/+3
If we didn't run succesfully vrend_destroy_shader_selector(), sel->sinfo.so_names might be NULL. Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: validate num_so_outputsMarc-André Lureau1-0/+3
Avoid out-of-bound acces of array so_info.output. Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: use a uint32_t for shader typeMarc-André Lureau2-2/+2
That way an value if (type > PIPE_SHADER_GEOMETRY) guard will actually work for all values. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: fix some vrend_sub_context leaksMarc-André Lureau1-0/+4
Fix leaks found thanks to AddressSanitizer. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: do not accept invalid formatMarc-André Lureau1-0/+4
That would later crash in util_format_description() or others Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: fix potential leakMarc-André Lureau1-0/+1
Found thanks to llvm scan-build. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-02-10renderer: fix potential leakMarc-André Lureau1-1/+4
Found thanks to llvm scan-build. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>