Add a missing AVClass member, check whether localaddr is null.
(Previously, localaddr was always a local stack buffer, while it
now also can be an avoption string which can be null.)
This fixes crashes when not passing any localaddr parameter, since
66028b7ba.
Signed-off-by: Martin Storsjö <martin@martin.st>
#endif
typedef struct UDPContext {
+ const AVClass *class;
int udp_fd;
int ttl;
int buffer_size;
if (((struct sockaddr *) &s->dest_addr)->sa_family)
family = ((struct sockaddr *) &s->dest_addr)->sa_family;
- res0 = udp_resolve_host(localaddr[0] ? localaddr : NULL, s->local_port,
+ res0 = udp_resolve_host((localaddr && localaddr[0]) ? localaddr : NULL, s->local_port,
SOCK_DGRAM, family, AI_PASSIVE);
if (res0 == 0)
goto fail;