bgmc: Fix av_malloc checks in ff_bgmc_init()
authorXi Wang <xi.wang@gmail.com>
Wed, 14 Nov 2012 18:45:24 +0000 (13:45 -0500)
committerDiego Biurrun <diego@biurrun.de>
Wed, 14 Nov 2012 22:03:36 +0000 (23:03 +0100)
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
libavcodec/bgmc.c

index 08b1337..ec8cf9b 100644 (file)
@@ -461,7 +461,7 @@ int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status)
     *cf_lut        = av_malloc(sizeof(*cf_lut)        * LUT_BUFF * 16 * LUT_SIZE);
     *cf_lut_status = av_malloc(sizeof(*cf_lut_status) * LUT_BUFF);
 
-    if (!cf_lut || !cf_lut_status) {
+    if (!*cf_lut || !*cf_lut_status) {
         ff_bgmc_end(cf_lut, cf_lut_status);
         av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
         return AVERROR(ENOMEM);