[FFmpeg-devel] [PATCH] dpx decoder: read sample aspect ratio

Peter Ross pross at xvid.org
Fri Apr 1 14:23:28 CEST 2011


---
 libavcodec/dpx.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index 7fff985..afd71cc 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;
-- 
1.7.4.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110401/09103de3/attachment.asc>


More information about the ffmpeg-devel mailing list