pcx: read sample aspect ratio
authorPaul B Mahol <onemda@gmail.com>
Thu, 11 Oct 2012 10:38:48 +0000 (10:38 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sat, 13 Oct 2012 08:22:26 +0000 (08:22 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/pcx.c

index 06f0f0f..722e89f 100644 (file)
@@ -102,6 +102,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     ymin = bytestream2_get_le16u(&gb);
     xmax = bytestream2_get_le16u(&gb);
     ymax = bytestream2_get_le16u(&gb);
+    avctx->sample_aspect_ratio.num = bytestream2_get_le16u(&gb);
+    avctx->sample_aspect_ratio.den = bytestream2_get_le16u(&gb);
 
     if (xmax < xmin || ymax < ymin) {
         av_log(avctx, AV_LOG_ERROR, "invalid image dimensions\n");
@@ -111,7 +113,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     w = xmax - xmin + 1;
     h = ymax - ymin + 1;
 
-    bytestream2_skipu(&gb, 53);
+    bytestream2_skipu(&gb, 49);
     nplanes            = bytestream2_get_byteu(&gb);
     bytes_per_line     = bytestream2_get_le16u(&gb);
     bytes_per_scanline = nplanes * bytes_per_line;