aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dpx.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2011-04-01 23:23:28 +1100
committerMichael Niedermayer <michaelni@gmx.at>2011-04-02 18:19:01 +0200
commit1b5282a221b9e9544c3807b56335d577eedda264 (patch)
treef01608930e55c95c67003d02cd6f885839340317 /libavcodec/dpx.c
parent4ce776d63691afd39900b5be48e20c4c42ae8057 (diff)
downloadffmpeg-1b5282a221b9e9544c3807b56335d577eedda264.tar.gz
dpx decoder: read sample aspect ratio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dpx.c')
-rw-r--r--libavcodec/dpx.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index 7fff98598b..afd71cc173 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -68,7 +68,7 @@ static int decode_frame(AVCodecContext *avctx,
unsigned int rgbBuffer;
- if (avpkt->size <= 0x324) {
+ if (avpkt->size <= 1634) {
av_log(avctx, AV_LOG_ERROR, "Packet too small for DPX header\n");
return AVERROR_INVALIDDATA;
}
@@ -106,6 +106,10 @@ static int decode_frame(AVCodecContext *avctx,
avctx->bits_per_raw_sample =
bits_per_color = buf[0];
+ buf += 825;
+ avctx->sample_aspect_ratio.num = read32(&buf, endian);
+ avctx->sample_aspect_ratio.den = read32(&buf, endian);
+
switch (descriptor) {
case 51: // RGBA
elements = 4;