summaryrefslogtreecommitdiff
path: root/doc/examples/transcode_aac.c
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/transcode_aac.c')
-rw-r--r--doc/examples/transcode_aac.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c
index 9fd5c00d60..3c7688cd33 100644
--- a/doc/examples/transcode_aac.c
+++ b/doc/examples/transcode_aac.c
@@ -171,8 +171,11 @@ static int open_output_file(const char *filename,
goto cleanup;
}
- av_strlcpy((*output_format_context)->filename, filename,
- sizeof((*output_format_context)->filename));
+ if (!((*output_format_context)->url = av_strdup(filename))) {
+ fprintf(stderr, "Could not allocate url.\n");
+ error = AVERROR(ENOMEM);
+ goto cleanup;
+ }
/* Find the encoder to be used by its name. */
if (!(output_codec = avcodec_find_encoder(AV_CODEC_ID_AAC))) {