aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-11-05 21:45:31 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2011-11-08 19:45:12 +0100
commit0411b1928965050a940155984a16ad82fe462fc1 (patch)
treef0b653c446eb9c832eb017c97d64bd1b557a4c4f
parentfd30240e98eb7e4ebdae26c17f9e7e49c99de709 (diff)
downloadffmpeg-0411b1928965050a940155984a16ad82fe462fc1.tar.gz
av_lzo1x_decode: properly handle negative buffer length.
Treating them like 0 is safest, current code would invoke undefined pointer arithmetic behaviour in this case. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> (cherry picked from commit b9242fd12f4be4a79e31fd0aa125ab8a48226896)
-rw-r--r--libavutil/lzo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavutil/lzo.c b/libavutil/lzo.c
index 40a41a424d..8407d7d376 100644
--- a/libavutil/lzo.c
+++ b/libavutil/lzo.c
@@ -175,11 +175,11 @@ int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen) {
int state= 0;
int x;
LZOContext c;
- if (!*outlen || !*inlen) {
+ if (*outlen <= 0 || *inlen <= 0) {
int res = 0;
- if (!*outlen)
+ if (*outlen <= 0)
res |= AV_LZO_OUTPUT_FULL;
- if (!*inlen)
+ if (*inlen <= 0)
res |= AV_LZO_INPUT_DEPLETED;
return res;
}