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

Michael Niedermayer michaelni
Sat Nov 3 04:29:57 CET 2007


On Wed, Oct 31, 2007 at 09:33:30PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> a while ago, I submitted patches to make RDT (RTSP/realmedia) work in
> ffmpeg. Here's split-up small patches to make it work, most of it is just
> rmdec re-arranging and such to call relevant code from a new rtp_rm.c file
> such that I don't have to reimplement the rm-specific code in RTP.
> 
> this patch - rmdec-allownulls.patch - allows rm_read_audio_stream_info() to
> be called with a NULL AVFormatContext, which is needed (before making it
> non-static - later patch) to call it from the rtp_rm.c file. If s is NULL,
> we don't want to store the strings in it, but just skip them. This makes a
> lot of sense for RTP/realmedia anyway, since the metadata is already
> transmitted in the SDP.
> 
> Ronald

> 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) {

i remember this, IIRC this was rejected because s cannot be NULL here
the code would have crashed due to dereferencing a NULL pointer above
still same issue -> still rejected

also s==NULL is not an appropriate way to check for RDT or whatever

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- 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/20071103/9b625940/attachment.pgp>



More information about the ffmpeg-devel mailing list