[FFmpeg-cvslog] Fix crash in ffmpeg.c with PIX_FMT_NONE

Michael Niedermayer michaelni at gmx.at
Wed Apr 6 02:25:20 CEST 2011


On Wed, Apr 06, 2011 at 01:25:59AM +0200, Stefano Sabatini wrote:
> On date Wednesday 2011-04-06 01:16:45 +0200, Michael Niedermayer wrote:
> > ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Apr  5 23:22:08 2011 +0200| [b5ef6f8eb452c37b19d973d61548725d7b91113e] | committer: Michael Niedermayer
> > 
> > Fix crash in ffmpeg.c with PIX_FMT_NONE
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > 
> > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b5ef6f8eb452c37b19d973d61548725d7b91113e
> > ---
> > 
> >  ffmpeg.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/ffmpeg.c b/ffmpeg.c
> > index cb23581..e2692de 100644
> > --- a/ffmpeg.c
> > +++ b/ffmpeg.c
> > @@ -657,6 +657,7 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec)
> >                  break;
> >          }
> >          if (*p == -1) {
> > +            if(st->codec->pix_fmt != PIX_FMT_NONE)
> >              av_log(NULL, AV_LOG_WARNING,
> >                     "Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'\n",
> >                     av_pix_fmt_descriptors[st->codec->pix_fmt].name,
> 
> What about a function:
> av_inline const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt)
> {
>     return (unsigned)pix_fmt < PIX_FMT_NB ?
>         av_pix_fmt_descriptors[st->codec->pix_fmt].name : NULL;
> }

i dont know
theres more than just .name that might need one and this quikly
could become messy.
also if the format is PIX_FMT_NONE then the "Incompatible... message
should not be printed

[...]
-- 
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-cvslog/attachments/20110406/f55644d3/attachment.asc>


More information about the ffmpeg-cvslog mailing list