[FFmpeg-devel] Collection of patches

Michael Niedermayer michaelni
Thu Apr 24 11:56:44 CEST 2008


On Thu, Apr 24, 2008 at 11:52:07AM +0200, Thorsten Jordan wrote:
> Michael Niedermayer schrieb:
> > On Tue, Apr 22, 2008 at 12:36:02PM +0200, Thorsten Jordan wrote:
> > [...]
> 
> >> Set pixel aspect ratio for xvid wrapper:
> >> libxvid_set_pixelaspect.patch
> > 
> > This is missing a check for sample_aspect_ratios validity.
> 
> how is this version? xvid limits for num/den are 1..255 according to xvid.h
> 
> -- 
> Regards, Thorsten

> Index: libavcodec/libxvidff.c
> ===================================================================
> --- libavcodec/libxvidff.c	(Revision 12933)
> +++ libavcodec/libxvidff.c	(Arbeitskopie)
> @@ -406,6 +406,17 @@
>      xvid_enc_frame.motion = x->me_flags;
>      xvid_enc_frame.type = XVID_TYPE_AUTO;
>  
> +    /* Pixel aspect ratio setting */

> +    if (avctx->sample_aspect_ratio.num < 1 || avctx->sample_aspect_ratio.num > 255
> +        || sample_aspect_ratio.den < 1 || sample_aspect_ratio.den > 255) {

vertical align

    if (avctx->sample_aspect_ratio.num < 1 || avctx->sample_aspect_ratio.num > 255
            || sample_aspect_ratio.den < 1 || sample_aspect_ratio.den > 255) {

at tis point you should see that there is something wrong ...


> +        av_log(avctx, AV_LOG_ERROR, "XviD: Invalid pixel aspect ratio %i/%i\n",

XviD: is unneeed avctx should already produce a libxvid? prefix.


> +            avctx->sample_aspect_ratio.num, sample_aspect_ratio.den);
> +            return -1;
> +    }
> +    xvid_enc_frame.par = XVID_PAR_EXT;

> +    xvid_enc_frame.par_width = avctx->sample_aspect_ratio.num;
> +    xvid_enc_frame.par_height = avctx->sample_aspect_ratio.den;

vertical align

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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080424/91e625f7/attachment.pgp>



More information about the ffmpeg-devel mailing list