aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/lzo.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-01-24 18:51:00 +0100
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-01-24 18:52:08 +0100
commit7d5082600ee63d879c2a325974ea09c8ace05019 (patch)
tree5319cf720f9a3212e2f9d3f03999343cc37db36c /libavutil/lzo.c
parent91d51ee4b5ea070df991d3dd46a6cca6a64e6155 (diff)
downloadffmpeg-7d5082600ee63d879c2a325974ea09c8ace05019.tar.gz
Handle input or output len of 0 properly in lzo decoder.
Diffstat (limited to 'libavutil/lzo.c')
-rw-r--r--libavutil/lzo.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/lzo.c b/libavutil/lzo.c
index a876fc7776..40a41a424d 100644
--- a/libavutil/lzo.c
+++ b/libavutil/lzo.c
@@ -175,6 +175,14 @@ int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen) {
int state= 0;
int x;
LZOContext c;
+ if (!*outlen || !*inlen) {
+ int res = 0;
+ if (!*outlen)
+ res |= AV_LZO_OUTPUT_FULL;
+ if (!*inlen)
+ res |= AV_LZO_INPUT_DEPLETED;
+ return res;
+ }
c.in = in;
c.in_end = (const uint8_t *)in + *inlen;
c.out = c.out_start = out;