Avoid a null pointer dereference on oom when decoding smacker.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 29 Jun 2013 14:04:07 +0000 (16:04 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 29 Jun 2013 14:04:07 +0000 (16:04 +0200)
Fixes ticket #2728.

libavcodec/smacker.c

index d0a10bf..0af11a9 100644 (file)
@@ -261,6 +261,8 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
     huff.maxlength = 0;
     huff.current = 0;
     huff.values = av_mallocz(huff.length * sizeof(int));
+    if (!huff.values)
+        return AVERROR(ENOMEM);
 
     if (smacker_decode_bigtree(gb, &huff, &ctx) < 0)
         err = -1;