[FFmpeg-devel] [PATCH] fix for roundup issue 2470

Michael Niedermayer michaelni
Sun Jan 2 04:35:55 CET 2011


On Sat, Jan 01, 2011 at 03:20:14PM -0500, Daniel Kang wrote:
> Sorry, I attached the wrong patch. That was meant for roundup issue
> 2471. The patch attached affects yuv4_read_header.
> 
> On Sat, Jan 1, 2011 at 2:52 PM, Daniel Kang <daniel.d.kang at gmail.com> wrote:
> 
> > I am a Google Code-In student, and as part of a task, I have used zzuf
> > to generate a file that crashes ffmpeg. The issue is caused by invalid
> > y4m headers, causing a divide by zero error. The roundup issue is 2470.
> >
> > I have attached a patch to fix this issue. It fixes the sanity check for
> > y4m invalid time stamps. Are there any comments?
> >

>  yuv4mpeg.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> efbb5d53747ae2bc4cb53bc787dcb409233aeb07  y4m_invalid_header_fix.diff
> From 728512463c62fffb09bfe5e45bf2b5793c38b61e Mon Sep 17 00:00:00 2001
> From: Daniel Kang <daniel.d.kang at gmail.com>
> Date: Fri, 31 Dec 2010 23:19:32 -0500
> Subject: [PATCH] fix ffmpeg crash for invalid y4m headers
> 
> ---
>  libavformat/yuv4mpeg.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
> index 99a1ce2..5e895ca 100644
> --- a/libavformat/yuv4mpeg.c
> +++ b/libavformat/yuv4mpeg.c
> @@ -316,7 +316,7 @@ static int yuv4_read_header(AVFormatContext *s, AVFormatParameters *ap)
>              pix_fmt = alt_pix_fmt;
>      }
> 
> -    if (raten == 0 && rated == 0) {
> +    if (raten == 0 || rated == 0) {

should be <=


[...]

--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110102/3f0ececd/attachment.pgp>



More information about the ffmpeg-devel mailing list