diff mbox

[FFmpeg-devel,2/4] lavf/matroskaenc: fix uninitialized read

Message ID 20161027061613.44001-2-rodger.combs@gmail.com
State Accepted
Commit be28ce210d5674603838e67509fc597f30c1bb1c
Headers show

Commit Message

Rodger Combs Oct. 27, 2016, 6:16 a.m. UTC
---
 libavformat/matroskaenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Almer Oct. 27, 2016, 1:29 p.m. UTC | #1
On 10/27/2016 3:16 AM, Rodger Combs wrote:
> ---
>  libavformat/matroskaenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index d91055f..c94a490 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -1547,7 +1547,7 @@ static int mkv_write_attachments(AVFormatContext *s)
>  
>      mkv->attachments = av_mallocz(sizeof(*mkv->attachments));
>      if (!mkv->attachments)
> -        return ret;
> +        return AVERROR(ENOMEM);
>  
>      av_lfg_init(&c, av_get_random_seed());

LGTM. Sorry about that.

Make sure to backport this to release/3.2 branch asap as well.
diff mbox

Patch

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index d91055f..c94a490 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1547,7 +1547,7 @@  static int mkv_write_attachments(AVFormatContext *s)
 
     mkv->attachments = av_mallocz(sizeof(*mkv->attachments));
     if (!mkv->attachments)
-        return ret;
+        return AVERROR(ENOMEM);
 
     av_lfg_init(&c, av_get_random_seed());