Merge commit '0f8512c4a87b89b4694053d8ffda48066ee1da62'

* commit '0f8512c4a87b89b4694053d8ffda48066ee1da62':
  mov: Validate spherical metadata version

Merged-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2017-10-17 15:27:43 -03:00
commit 552d2cb6f7

View File

@ -4823,7 +4823,7 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
int size, layout;
int size, version, layout;
int32_t yaw, pitch, roll;
uint32_t l = 0, t = 0, r = 0, b = 0;
uint32_t tag, padding = 0;
@ -4849,7 +4849,13 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log(c->fc, AV_LOG_ERROR, "Missing spherical video header\n");
return 0;
}
avio_skip(pb, 4); /* version + flags */
version = avio_r8(pb);
if (version != 0) {
av_log(c->fc, AV_LOG_WARNING, "Unknown spherical version %d\n",
version);
return 0;
}
avio_skip(pb, 3); /* flags */
avio_skip(pb, size - 12); /* metadata_source */
size = avio_rb32(pb);
@ -4871,7 +4877,13 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log(c->fc, AV_LOG_ERROR, "Missing projection header box\n");
return 0;
}
avio_skip(pb, 4); /* version + flags */
version = avio_r8(pb);
if (version != 0) {
av_log(c->fc, AV_LOG_WARNING, "Unknown spherical version %d\n",
version);
return 0;
}
avio_skip(pb, 3); /* flags */
/* 16.16 fixed point */
yaw = avio_rb32(pb);
@ -4883,7 +4895,13 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return AVERROR_INVALIDDATA;
tag = avio_rl32(pb);
avio_skip(pb, 4); /* version + flags */
version = avio_r8(pb);
if (version != 0) {
av_log(c->fc, AV_LOG_WARNING, "Unknown spherical version %d\n",
version);
return 0;
}
avio_skip(pb, 3); /* flags */
switch (tag) {
case MKTAG('c','b','m','p'):
layout = avio_rb32(pb);