changeset 5655:711922c1e9e7 libavcodec

10l, add check forgotten in last commit
author reimar
date Sun, 09 Sep 2007 08:52:53 +0000
parents 93a54fcfa2f4
children 3f7d66453c2e
files nuv.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nuv.c	Sun Sep 09 08:42:49 2007 +0000
+++ b/nuv.c	Sun Sep 09 08:52:53 2007 +0000
@@ -158,6 +158,10 @@
     if (c->codec_frameheader) {
         get_quant_quality(c, buf[10]);
         rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
+        if (buf_size < 12) {
+            av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame\n");
+            return -1;
+        }
         buf = &buf[12];
         buf_size -= 12;
     }