Browse Source

dpx: sanitize aspect ratio.

Fixes some samples where the ratio is declared as -1/-1.
tags/n1.0
Nicolas George 13 years ago
parent
commit
8b421fad24
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/dpx.c

+ 6
- 0
libavcodec/dpx.c View File

@@ -109,6 +109,12 @@ static int decode_frame(AVCodecContext *avctx,
buf += 825;
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)
av_reduce(&avctx->sample_aspect_ratio.num, &avctx->sample_aspect_ratio.den,
avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den,
0x10000);
else
avctx->sample_aspect_ratio = (AVRational){ 0, 0 };

switch (descriptor) {
case 51: // RGBA


Loading…
Cancel
Save