mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
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
This commit is contained in:
parent
048905a484
commit
6cf7e81f8c
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user