[FFmpeg-devel] [PATCH 1/2] pcx: read sample aspect ratio

Michael Niedermayer michaelni at gmx.at
Fri Oct 12 00:28:56 CEST 2012


On Thu, Oct 11, 2012 at 10:59:01AM +0000, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/pcx.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c
> index 06f0f0f..9168aef 100644
> --- a/libavcodec/pcx.c
> +++ b/libavcodec/pcx.c
> @@ -102,6 +102,10 @@ 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 (avctx->sample_aspect_ratio.den == 0)
> +        avctx->sample_aspect_ratio.den = 1;

why is this needed ?
it would give odd results if num was 10 for example

rest LGTM

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- 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/20121012/45be6352/attachment.asc>


More information about the ffmpeg-devel mailing list