On 12/12/11 19:53, Anton Khirnov wrote:

On Mon, 12 Dec 2011 19:12:13 +0100, Luca Barbato<[email protected]>  wrote:
On 12/12/11 18:49, Anton Khirnov wrote:


On Mon, 12 Dec 2011 18:24:29 +0100, Luca Barbato<[email protected]>   wrote:
Fix the iformat/oformat typo and make the function behave if
the context is already NULL.
---
   libavformat/utils.c |    5 ++++-
   1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8b749ad..865edbc 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3222,6 +3222,9 @@ int av_write_trailer(AVFormatContext *s)
   {
       int ret, i;

+    if (!s || !s->oformat)
+        return 0;
+

Why would this ever happen?

free() pattern compliance, just to be safe.

Not sure if we should consider having av_write_trailer more than once
wrong but if it happens currently we just segfault.

I am not sure this is a very good idea.
Overzealous checks like this might hide programming errors in the
calling code.

I can change the return value and/or add an av_log debug message or drop the hunk completely.

lu

--

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to