avformat/avienc: Correct possible dereference of null
authorRoman Savchenko <gmstima@gmail.com>
Thu, 28 May 2015 15:25:56 +0000 (18:25 +0300)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 28 May 2015 22:04:41 +0000 (00:04 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/avienc.c

index 5396a7d..e5609d9 100644 (file)
@@ -386,6 +386,8 @@ static int avi_write_header(AVFormatContext *s)
                 t = NULL;
                 if (langstr) {
                     char* str = av_asprintf("Subtitle - %s-xx;02", langstr);
+                    if (!str)
+                        return AVERROR(ENOMEM);
                     ff_riff_write_info_tag(s->pb, "strn", str);
                     av_free(str);
                 }