[FFmpeg-devel] [PATCH] allow to call rm_read_audio_stream_info() with NULL AVFormatcontext

Michael Niedermayer michaelni
Mon Nov 5 02:24:44 CET 2007


Hi

On Sun, Nov 04, 2007 at 03:33:33PM -0800, Ronald S. Bultje wrote:
> Hi,
> 
> $attached does $subj, which I need for later RDT realmedia/rtsp work.
> Index: ffmpeg/libavformat/rmdec.c
> ===================================================================
> --- ffmpeg.orig/libavformat/rmdec.c	2007-10-24 08:43:16.000000000 -0400
> +++ ffmpeg/libavformat/rmdec.c	2007-10-30 23:46:56.000000000 -0400
> @@ -62,10 +62,13 @@
>          /* very old version */
>          for(i = 0; i < 14; i++)
>              get_byte(pb);
> -        get_str8(pb, s->title, sizeof(s->title));
> -        get_str8(pb, s->author, sizeof(s->author));
> -        get_str8(pb, s->copyright, sizeof(s->copyright));
> -        get_str8(pb, s->comment, sizeof(s->comment));
> +        if (s != NULL) {

darn, how often do i need to repeat it, i think thats at least the 3rd time
i see this patch
rejected!!!

the code will CRASH if s is NULL, open you eyes:
    ByteIOContext *pb = &s->pb;
pb is not valid here, &NULL->pb; is not a valid pointer

    char buf[256];
    uint32_t version;
    int i;

    /* ra type header */
    version = get_be32(pb); /* version */
                 ^^^^^^^^^
CRASH!

and besides that this code cannot work, setting the main context to
NULL is not an appropriate way to signal that some fields should not
be written or that RDT is used or anything else

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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- 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/20071105/699916c1/attachment.pgp>



More information about the ffmpeg-devel mailing list