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.

This part is ok. I wonder what i was smoking when i wrote this.

There is something similar for iformat that might need a cleanup as well.


--

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