]> git.sesse.net Git - ffmpeg/blobdiff - avprobe.c
libavformat: Use ffio_free_dyn_buf where applicable
[ffmpeg] / avprobe.c
index c56ac27efaa9bb76dbfbac5d4ecf5b5eef7003fd..926a781a0ef2fa23a8fe93ff86c0ff60de0f9b68 100644 (file)
--- a/avprobe.c
+++ b/avprobe.c
@@ -84,14 +84,14 @@ typedef enum {
     OBJECT
 } PrintElementType;
 
-typedef struct {
+typedef struct PrintElement {
     const char *name;
     PrintElementType type;
     int64_t index;
     int64_t nb_elems;
 } PrintElement;
 
-typedef struct {
+typedef struct PrintContext {
     PrintElement *prefix;
     int level;
     void (*print_header)(void);
@@ -181,7 +181,7 @@ static void ini_print_object_header(const char *name)
     }
 
     avio_printf(probe_out, "%s", name);
-    if (el && el->type == ARRAY)
+    if (el->type == ARRAY)
         avio_printf(probe_out, ".%"PRId64"", el->nb_elems);
     avio_printf(probe_out, "]\n");
 }
@@ -302,6 +302,8 @@ static void old_print_object_header(const char *name)
         return;
 
     str = p = av_strdup(name);
+    if (!str)
+        return;
     while (*p) {
         *p = av_toupper(*p);
         p++;
@@ -319,6 +321,8 @@ static void old_print_object_footer(const char *name)
         return;
 
     str = p = av_strdup(name);
+    if (!str)
+        return;
     while (*p) {
         *p = av_toupper(*p);
         p++;