Commit f9315aa7 authored by reimar's avatar reimar

Fix extreme stupidity: buffer size check must of course be before buffer use!


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10443 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 15cba93b
...@@ -156,12 +156,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, ...@@ -156,12 +156,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
buf_size = c->decomp_size; buf_size = c->decomp_size;
} }
if (c->codec_frameheader) { 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) { if (buf_size < 12) {
av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame\n"); av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame\n");
return -1; 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 = &buf[12];
buf_size -= 12; buf_size -= 12;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment