On Mon, Jul 28, 2014 at 11:55:38AM +0200, [email protected] wrote:
> From: Marvin Scholz <[email protected]>
>
> Check if strdup failed
> ---
> Icecast is basically a convenience wrapper around the HTTP protocol.
> ---
Add your annotations below, not above, the ---, otherwise they replace
the log message.
> --- /dev/null
> +++ b/libavformat/icecast.c
> @@ -0,0 +1,227 @@
> +static int icecast_open(URLContext *h, const char *uri, int flags)
> +{
> + // Build header strings
> + headers = cat_header(headers, "Ice-Name", s->name);
> + headers = cat_header(headers, "Ice-Description", s->description);
> + headers = cat_header(headers, "Ice-URL", s->url);
> + headers = cat_header(headers, "Ice-Genre", s->genre);
> + headers = cat_header(headers, "Ice-Public", s->public ? "1" : "0");
> + if (!headers) {
> + ret = AVERROR(ENOMEM);
> + goto cleanup;
> + }
> +
trailing whitespace on this line
> + // Check for auth data in URI
> + if (auth[0]) {
> + char *sep = strchr(auth,':');
> + if (sep) {
> + *sep = 0;
> + sep++;
> + if (s->pass) {
> + av_free(s->pass);
> + av_log(h, AV_LOG_WARNING, "Overwriting -password <pass> with
> URI password!\n");
> + }
> + if (!(s->pass = av_strdup(sep))) {
> + ret = AVERROR(ENOMEM);
> + goto cleanup;
> + }
> + }
> + if (!(user = av_strdup(auth))) {
> + ret = AVERROR(ENOMEM);
> + goto cleanup;
> + }
> + }
> +
> +cleanup:
> + // Free variables
> + if (user)
> + av_freep(&user);
> + if (headers)
> + av_freep(&headers);
> + av_dict_free(&opt_dict);
> +
> + return ret;
> +}
Where does s->pass get freed?
> + if (memcmp(buf, oggs, sizeof(oggs)) == 0) {
> + av_log(h, AV_LOG_WARNING, "Streaming ogg but appropriate
> content type NOT set!\n");
Ogg
> + } else if (memcmp(buf, opus, sizeof(opus)) == 0) {
> + av_log(h, AV_LOG_WARNING, "Streaming opus but appropriate
> content type NOT set!\n");
Opus
> + } else if (memcmp(buf, webm, sizeof(webm)) == 0) {
> + av_log(h, AV_LOG_WARNING, "Streaming webm but appropriate
> content type NOT set!\n");
WebM
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel