[FFmpeg-cvslog] Handle input or output len of 0 properly in lzo decoder.

Reimar Döffinger git
Mon Jan 24 23:14:44 CET 2011


ffmpeg | branch: master | Reimar D?ffinger <Reimar.Doeffinger at gmx.de> | Mon Jan 24 18:51:00 2011 +0100| [7d5082600ee63d879c2a325974ea09c8ace05019] | committer: Reimar D?ffinger

Handle input or output len of 0 properly in lzo decoder.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d5082600ee63d879c2a325974ea09c8ace05019
---

 libavutil/lzo.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libavutil/lzo.c b/libavutil/lzo.c
index a876fc7..40a41a4 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;




More information about the ffmpeg-cvslog mailing list