From 4d538263a7983df70fdec26db8125fd3345efc07 Mon Sep 17 00:00:00 2001
From: Daniel Kang <daniel.d.kang@gmail.com>
Date: Sun, 9 Jan 2011 21:54:46 -0500
Subject: [PATCH] Adds check for null pointer in nuv decoder

---
 libavcodec/nuv.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index 26dcfd0..5648422 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -178,6 +178,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     buf_size -= 12;
     if (comptype == NUV_RTJPEG_IN_LZO || comptype == NUV_LZO) {
         int outlen = c->decomp_size, inlen = buf_size;
+        if (c->decomp_buf == NULL) {
+            av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
+            return -1;
+        }
         if (av_lzo1x_decode(c->decomp_buf, &outlen, buf, &inlen))
             av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
         buf = c->decomp_buf;
--
1.7.2.2

