[FFmpeg-devel] [PATCH 1/3] Take avcodec_align_dimensions2 into account in ffplay's get_buffer

Michael Niedermayer michaelni
Mon May 24 11:54:43 CEST 2010


On Sun, May 23, 2010 at 09:02:47PM -0400, David Conrad wrote:
> ---
>  ffplay.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/ffplay.c b/ffplay.c
> index 2e2149e..db84fa3 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -1592,7 +1592,7 @@ static int input_get_buffer(AVCodecContext *codec, AVFrame *pic)
>          unsigned vshift = i == 0 ? 0 : av_pix_fmt_descriptors[ref->pic->format].log2_chroma_h;
>  
>          if (ref->data[i]) {
> -            ref->data[i]    += (edge >> hshift) + ((edge * ref->linesize[i]) >> vshift);
> +            ref->data[i] += FFALIGN((edge >> hshift) + ((edge * ref->linesize[i]) >> vshift), stride[i]);

this doesnt look completely safe
that is if it does change the value (which maybe it never does) then it
does not look to me like the buffer would be guranteed to be large enough

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- 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/20100524/8560ee91/attachment.pgp>



More information about the ffmpeg-devel mailing list