diff options
author | Paul B Mahol <onemda@gmail.com> | 2018-12-05 14:25:17 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2018-12-07 19:44:57 +0100 |
commit | 0f8383005c97766e94440c20f63564d66730e0e6 (patch) | |
tree | 7d3e4981da0c4316bc78c3bd3ccacb621a8869ce /libavcodec/dpx.c | |
parent | 05a61a02d628a04fa8a672ef062adf4de2ed7df6 (diff) | |
download | ffmpeg-0f8383005c97766e94440c20f63564d66730e0e6.tar.gz |
avcodec/dpx: check version of format header too
Diffstat (limited to 'libavcodec/dpx.c')
-rw-r--r-- | libavcodec/dpx.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 538a1b9943..0297287938 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -106,6 +106,7 @@ static int decode_frame(AVCodecContext *avctx, int buf_size = avpkt->size; AVFrame *const p = data; uint8_t *ptr[AV_NUM_DATA_POINTERS]; + uint32_t header_version, version = 0; unsigned int offset; int magic_num, endian; @@ -141,6 +142,15 @@ static int decode_frame(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } + header_version = read32(&buf, 0); + if (header_version == MKTAG('V','1','.','0')) + version = 1; + if (header_version == MKTAG('V','2','.','0')) + version = 2; + if (!version) + av_log(avctx, AV_LOG_WARNING, "Unknown header format version %s.\n", + av_fourcc2str(header_version)); + // Check encryption buf = avpkt->data + 660; ret = read32(&buf, endian); |