aboutsummaryrefslogtreecommitdiff
path: root/gst-libs/ext/libav/libavcodec/nuv.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/ext/libav/libavcodec/nuv.c')
-rw-r--r--gst-libs/ext/libav/libavcodec/nuv.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gst-libs/ext/libav/libavcodec/nuv.c b/gst-libs/ext/libav/libavcodec/nuv.c
index 94962b5..519b550 100644
--- a/gst-libs/ext/libav/libavcodec/nuv.c
+++ b/gst-libs/ext/libav/libavcodec/nuv.c
@@ -184,8 +184,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
}
if (c->codec_frameheader) {
int w, h, q;
- if (buf[0] != 'V' || buf_size < 12) {
- av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame (wrong codec_tag?)\n");
+ if (buf_size < RTJPEG_HEADER_SIZE || buf[4] != RTJPEG_HEADER_SIZE ||
+ buf[5] != RTJPEG_FILE_VERSION) {
+ av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame\n");
return AVERROR_INVALIDDATA;
}
w = AV_RL16(&buf[6]);
@@ -193,8 +194,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
q = buf[10];
if (!codec_reinit(avctx, w, h, q))
return -1;
- buf = &buf[12];
- buf_size -= 12;
+ buf = &buf[RTJPEG_HEADER_SIZE];
+ buf_size -= RTJPEG_HEADER_SIZE;
}
if (keyframe && c->pic.data[0])