DPX decoder: read sample aspect ratio
authorPeter Ross <pross@xvid.org>
Fri, 1 Apr 2011 12:23:28 +0000 (23:23 +1100)
committerReinhard Tartler <siretart@tauware.de>
Sun, 1 May 2011 17:35:55 +0000 (19:35 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dpx.c

index 82891d6..0722dd0 100644 (file)
@@ -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;