Browse code

lavf: Remove a now useless parameter to ffurl_register_protocol

This was added in 9b07a2dc02e9 as an ABI hack to allow older
code built with lavf 52 to register protocols even if the size
of the URLProtocol struct was increased. Later, registering
protocols from outside of lavf was removed and this workaround
isn't needed any longer since lavf 53.

This removes an unchecked malloc and a memory leak for the cases
when this workaround actually was used - which it hasn't since
lavf 53.

Signed-off-by: Martin Storsjö <martin@martin.st>

Martin Storsjö authored on 2013/10/30 05:52:09
Showing 3 changed files
... ...
@@ -45,8 +45,7 @@
45 45
     {                                                                   \
46 46
         extern URLProtocol ff_##x##_protocol;                           \
47 47
         if (CONFIG_##X##_PROTOCOL)                                      \
48
-            ffurl_register_protocol(&ff_##x##_protocol,                 \
49
-                                    sizeof(ff_##x##_protocol));         \
48
+            ffurl_register_protocol(&ff_##x##_protocol);                \
50 49
     }
51 50
 
52 51
 void av_register_all(void)
... ...
@@ -94,14 +94,9 @@ const char *avio_enum_protocols(void **opaque, int output)
94 94
     return avio_enum_protocols(opaque, output);
95 95
 }
96 96
 
97
-int ffurl_register_protocol(URLProtocol *protocol, int size)
97
+int ffurl_register_protocol(URLProtocol *protocol)
98 98
 {
99 99
     URLProtocol **p;
100
-    if (size < sizeof(URLProtocol)) {
101
-        URLProtocol *temp = av_mallocz(sizeof(URLProtocol));
102
-        memcpy(temp, protocol, size);
103
-        protocol = temp;
104
-    }
105 100
     p = &first_protocol;
106 101
     while (*p != NULL)
107 102
         p = &(*p)->next;
... ...
@@ -224,10 +224,8 @@ int ffurl_shutdown(URLContext *h, int flags);
224 224
 
225 225
 /**
226 226
  * Register the URLProtocol protocol.
227
- *
228
- * @param size the size of the URLProtocol struct referenced
229 227
  */
230
-int ffurl_register_protocol(URLProtocol *protocol, int size);
228
+int ffurl_register_protocol(URLProtocol *protocol);
231 229
 
232 230
 /**
233 231
  * Check if the user has requested to interrup a blocking function