summaryrefslogtreecommitdiff
path: root/libavcodec/nuv.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2007-09-09 09:00:12 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2007-09-09 09:00:12 +0000
commit6cf7e81f8cce20f1b39ab5a1485682b698db7e60 (patch)
treefa6870e8c82d3bc7a5975c5fd525785ad3b8af26 /libavcodec/nuv.c
parent048905a484cde2abc051ed965d5ac6b973acbc79 (diff)
Fix extreme stupidity: buffer size check must of course be before buffer use!
Originally committed as revision 10443 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/nuv.c')
-rw-r--r--libavcodec/nuv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index d07c868aa5..232cea3fc9 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -156,12 +156,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
buf_size = c->decomp_size;
}
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;
}
+ get_quant_quality(c, buf[10]);
+ rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
buf = &buf[12];
buf_size -= 12;
}