[FFmpeg-devel] [PATCH 7/7] Add check in av_write_header() which validates the rawvideo codec tag.

Michael Niedermayer michaelni
Tue Jun 1 17:53:36 CEST 2010


On Tue, Jun 01, 2010 at 12:39:41PM +0200, Stefano Sabatini wrote:
> On date Thursday 2010-05-27 21:59:52 +0200, Michael Niedermayer encoded:
> > On Thu, May 27, 2010 at 12:28:28AM +0200, Stefano Sabatini wrote:
> > > Make the function fail if there is no codec tag associated to that
> > > pixel format.
> > > ---
> > >  libavformat/utils.c |    9 +++++++++
> > >  1 files changed, 9 insertions(+), 0 deletions(-)
> > 
> > this patch requires as prereqesite avienc/riff to override codec_tag
> > so its 0 for rgb formats
> 
> The problem with the current code is that if
> avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt) in rawenc.c returns 0,
> then av_write_header() does:
> st->codec->codec_tag= av_codec_get_tag(s->oformat->codec_tag, st->codec->codec_id);
> 
> which sets the codec tag to the first entry with codec id == RAWVIDEO,
> which may have nothing to do with the pixel format of the output
> stream.

you are confused.
codec_tag must be 0 for rgb in avi. and the first entry is 0
if rgb in avi is stored with non 0 codec_tag currently then you
introduced a very serious bug. And the fix is to override it in
riff.c as i said multiple times.

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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- 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/20100601/0187c466/attachment.pgp>



More information about the ffmpeg-devel mailing list