[FFmpeg-devel] [PATCH] fix ffplay eof memleak (issue806)

Michael Niedermayer michaelni
Sat Feb 7 03:03:57 CET 2009


On Sat, Feb 07, 2009 at 12:03:51PM +1100, Peter Ross wrote:
> $subject.
> 
> XREF: https://roundup.ffmpeg.org/roundup/ffmpeg/issue806
> 
> -- Peter
> (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)

> Index: ffplay.c
> ===================================================================
> --- ffplay.c	(revision 17025)
> +++ ffplay.c	(working copy)
> @@ -2079,7 +2079,8 @@
>          }
>          ret = av_read_frame(ic, pkt);
>          if (ret < 0) {

> -            if (url_ferror(ic->pb) == 0) {
> +            if (!url_feof(ic->pb) && url_ferror(ic->pb) == 0) {

i remember problems with EOF detection, the return of url_* is just not
correct to detect it. The reason is they are related to the file pointer
and not if the demuxer reached the end of the available packets
we should add a special return code to indicate EOF maybe, someone
suggested that already not too long ago ..


> +                av_free_packet(pkt);

this looks wrong, a negative return from av_read_frame() really means
that no packet has been allocated

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

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- 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/20090207/6b4247ed/attachment.pgp>



More information about the ffmpeg-devel mailing list