summaryrefslogtreecommitdiff
path: root/libavutil/lzo.h
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-12-30 10:37:33 +0100
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-12-30 10:37:33 +0100
commit874da652b307fe0d2bec08fc5916a9a82537f40c (patch)
tree74a10d27d3f34e7ad2bc6ba00d77338283976f66 /libavutil/lzo.h
parentb0143da80656f286b3e2363f3ddb6f81c4a0fbf5 (diff)
downloadffmpeg-874da652b307fe0d2bec08fc5916a9a82537f40c.tar.gz
Avoid av_memcpy_backptr hang without extra branch.
This only happens for a "back" value of 0 which is invalid anyway, but lcldec does not properly validate input. Also extend the documentation to specify valid values. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavutil/lzo.h')
-rw-r--r--libavutil/lzo.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavutil/lzo.h b/libavutil/lzo.h
index d60d8d7487..379c08c8c7 100644
--- a/libavutil/lzo.h
+++ b/libavutil/lzo.h
@@ -62,11 +62,14 @@ int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
/**
* @brief deliberately overlapping memcpy implementation
* @param dst destination buffer; must be padded with 12 additional bytes
- * @param back how many bytes back we start (the initial size of the overlapping window)
+ * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0
* @param cnt number of bytes to copy, must be >= 0
*
* cnt > back is valid, this will copy the bytes we just copied,
* thus creating a repeating pattern with a period length of back.
+ * Note that lcldec currently can set back == 0 - which is wrong and
+ * makes no sense, but the code should at least avoid crashing or hanging
+ * for this case.
*/
void av_memcpy_backptr(uint8_t *dst, int back, int cnt);