mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
nuv: check per-frame header for validity.
Since it contains dimensions parsing an invalid one has rather annoying effects. Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
785baa738a
commit
f6afacdb3b
@ -184,9 +184,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||
}
|
||||
if (c->codec_frameheader) {
|
||||
int w, h, q;
|
||||
if (buf_size < 12) {
|
||||
av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame\n");
|
||||
return -1;
|
||||
if (buf[0] != 'V' || buf_size < 12) {
|
||||
av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame (wrong codec_tag?)\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
w = AV_RL16(&buf[6]);
|
||||
h = AV_RL16(&buf[8]);
|
||||
|
Loading…
Reference in New Issue
Block a user