avutil/hmac: Check av_hmac_alloc() return code
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 30 Mar 2015 21:07:19 +0000 (23:07 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 30 Mar 2015 21:24:33 +0000 (23:24 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/hmac.c

index 300436c..b63d1b2 100644 (file)
@@ -245,6 +245,8 @@ int main(void)
     /* SHA-2 */
     while (i <= AV_HMAC_SHA512) {
         hmac = av_hmac_alloc(i);
+        if (!hmac)
+            return 1;
         // RFC 4231 test vectors
         test(hmac, key1, sizeof(key1), data1, sizeof(data1));
         test(hmac, key2, sizeof(key2), data2, sizeof(data2));