Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 359d8fcd authored by Martin Storsjo's avatar Martin Storsjo
Browse files

avcenc: Initialize all memory allocated by the CBAVC_Malloc callback function

Valgrind reported use of uninitialized memory in AVCEncodeSlice,
which this fixes.

Change-Id: Ia09ad3e50d05b2b0487a4d588d9b00fc0828c816
parent 23da4cf3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ typedef void (*FuctionType_FrameUnbind)(void *userData, int);
    memory usage.
\param "size" "Size of requested memory in bytes."
\param "attribute" "Some value specifying types, priority, etc. of the memory."
\return "The address of the allocated memory"
\return "The address of the allocated, zero-initialized memory"
*/
typedef void* (*FunctionType_Malloc)(void *userData, int32 size, int attribute);

+4 −1
Original line number Diff line number Diff line
@@ -133,7 +133,10 @@ inline static void ConvertYUV420SemiPlanarToYUV420Planar(

static void* MallocWrapper(
        void *userData, int32_t size, int32_t attrs) {
    return malloc(size);
    void *ptr = malloc(size);
    if (ptr)
        memset(ptr, 0, size);
    return ptr;
}

static void FreeWrapper(void *userData, void* ptr) {