C++: query-specific model for ffmpeg allocator

This commit is contained in:
Robert Marsh
2022-09-07 13:47:23 -04:00
committed by Mathias Vorreiter Pedersen
parent 61017a7997
commit 0fcfe5772f

View File

@@ -8,6 +8,13 @@ import semmle.code.cpp.valuenumbering.GlobalValueNumbering
import semmle.code.cpp.models.interfaces.Allocation
import semmle.code.cpp.ir.IRConfiguration
// temporary - custom allocator for ffmpeg
class AvBufferAlloc extends AllocationFunction {
AvBufferAlloc() { this.hasGlobalName(["av_mallocz", "av_malloc"]) }
override int getSizeArg() { result = 0 }
}
predicate bounded(Instruction i, Bound b, int delta, boolean upper) {
// TODO: reason
semBounded(getSemanticExpr(i), b, delta, upper, _)