[FFmpeg-devel] [PATCH] Fixed NULL deference in mov muxer
Baptiste Coudurier
baptiste.coudurier
Tue Sep 2 19:51:01 CEST 2008
Hi,
Laurent Aimar wrote:
> The attached patch fixed a NULL deference in mov muxer for unsupported
> track.
Interesting, what do you mean by unsupported ?
Are you creating a track with no samples ?
Code in mov_write_header:
for(i=0; i<s->nb_streams; i++){
AVStream *st= s->streams[i];
MOVTrack *track= &mov->tracks[i];
track->enc = st->codec;
This is weird, enc cannot be NULL subsequently, if st->codec is not
NULL, is st->codec NULL ?
>
> Index: libavformat/movenc.c
> ===================================================================
> --- libavformat/movenc.c (revision 14827)
> +++ libavformat/movenc.c (working copy)
> @@ -1242,11 +1242,13 @@
> int i;
> int bitexact = 0;
>
> - for (i = 0; i < s->nb_streams; i++)
> + for (i = 0; i < s->nb_streams; i++) {
> + if (mov->tracks[i].entry <= 0) continue;
> if (mov->tracks[i].enc->flags & CODEC_FLAG_BITEXACT) {
> bitexact = 1;
> break;
> }
> + }
>
[...]
--
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc. http://www.smartjog.com
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
More information about the ffmpeg-devel
mailing list