Commit 0f838300 authored by Paul B Mahol's avatar Paul B Mahol

avcodec/dpx: check version of format header too

parent 05a61a02
...@@ -106,6 +106,7 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -106,6 +106,7 @@ static int decode_frame(AVCodecContext *avctx,
int buf_size = avpkt->size; int buf_size = avpkt->size;
AVFrame *const p = data; AVFrame *const p = data;
uint8_t *ptr[AV_NUM_DATA_POINTERS]; uint8_t *ptr[AV_NUM_DATA_POINTERS];
uint32_t header_version, version = 0;
unsigned int offset; unsigned int offset;
int magic_num, endian; int magic_num, endian;
...@@ -141,6 +142,15 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -141,6 +142,15 @@ static int decode_frame(AVCodecContext *avctx,
return AVERROR_INVALIDDATA; 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 // Check encryption
buf = avpkt->data + 660; buf = avpkt->data + 660;
ret = read32(&buf, endian); ret = read32(&buf, endian);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment