summaryrefslogtreecommitdiff
path: root/libavcodec/dpx.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-05 01:38:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-10-05 01:41:44 +0200
commit23f105a83086efd58f62217bed72370e4835132a (patch)
treecbecbbdebc13e03a906e84ddff56fb0cfac8cd80 /libavcodec/dpx.c
parentfb726ef09a40d4ba4ca4e823f868b0f869a73bcd (diff)
avcodec/dpx: check encoding
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dpx.c')
-rw-r--r--libavcodec/dpx.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index 59845c700d..9609a5265b 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -78,6 +78,7 @@ static int decode_frame(AVCodecContext *avctx,
int magic_num, endian;
int x, y, i, ret;
int w, h, bits_per_color, descriptor, elements, packing, total_size;
+ int encoding;
unsigned int rgbBuffer = 0;
int n_datum = 0;
@@ -126,8 +127,15 @@ static int decode_frame(AVCodecContext *avctx,
bits_per_color = buf[0];
buf++;
packing = read16(&buf, endian);
+ encoding = read16(&buf, endian);
- buf += 822;
+ if (encoding) {
+ avpriv_report_missing_feature(avctx,
+ "Unsupported encoding %d\n", encoding);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ buf += 820;
avctx->sample_aspect_ratio.num = read32(&buf, endian);
avctx->sample_aspect_ratio.den = read32(&buf, endian);
if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0)