Skip to content
Snippets Groups Projects
Commit f6afacdb authored by Reimar Döffinger's avatar Reimar Döffinger Committed by Anton Khirnov
Browse files

nuv: check per-frame header for validity.


Since it contains dimensions parsing an invalid one has rather
annoying effects.

Signed-off-by: default avatarAnton Khirnov <anton@khirnov.net>
parent 785baa73
No related branches found
No related tags found
No related merge requests found
...@@ -184,9 +184,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, ...@@ -184,9 +184,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
} }
if (c->codec_frameheader) { if (c->codec_frameheader) {
int w, h, q; int w, h, q;
if (buf_size < 12) { if (buf[0] != 'V' || buf_size < 12) {
av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame\n"); av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame (wrong codec_tag?)\n");
return -1; return AVERROR_INVALIDDATA;
} }
w = AV_RL16(&buf[6]); w = AV_RL16(&buf[6]);
h = AV_RL16(&buf[8]); h = AV_RL16(&buf[8]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment