brillcodec: changed memory allocation function.
authorKitae Kim <kt920.kim@samsung.com>
Fri, 13 Sep 2013 10:08:09 +0000 (19:08 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Fri, 13 Sep 2013 10:08:09 +0000 (19:08 +0900)
Allocate memory with g_malloc and then deallocate it with av_free for FFmpeg.
The above case causes segv problem on Windows.

Change-Id: I163fbd07228b40a6bfc2edd66a9aafe3abb9d4c4
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
tizen/src/hw/maru_brill_codec.c

index ecbc659..4c22e5b 100644 (file)
@@ -990,7 +990,7 @@ static void read_codec_init_data(AVCodecContext *avctx, uint8_t *mem_buf)
     if (avctx->extradata_size > 0) {
         TRACE("extradata size: %d.\n", avctx->extradata_size);
         avctx->extradata =
-            g_malloc0(ROUND_UP_X(avctx->extradata_size +
+            av_mallocz(ROUND_UP_X(avctx->extradata_size +
                         FF_INPUT_BUFFER_PADDING_SIZE, 4));
         if (avctx->extradata) {
             memcpy(avctx->extradata, mem_buf + size, avctx->extradata_size);
@@ -998,7 +998,7 @@ static void read_codec_init_data(AVCodecContext *avctx, uint8_t *mem_buf)
     } else {
         TRACE("no extra data.\n");
         avctx->extradata =
-            g_malloc0(ROUND_UP_X(FF_INPUT_BUFFER_PADDING_SIZE, 4));
+            av_mallocz(ROUND_UP_X(FF_INPUT_BUFFER_PADDING_SIZE, 4));
     }
 }