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

Commit 08464604 authored by George Burgess IV's avatar George Burgess IV
Browse files

av: fix static analyzer complaints

This CL fixes a few static analyzer complaints in av code.

> frameworks/av/media/codecs/amrnb/enc/src/cor_h_x2.cpp:278:26: warning:
1st function call argument is an uninitialized value
[clang-analyzer-core.CallAndMessage]

This is a valid complaint, but we force all uninitialized memory to
zero, so it seems harmless to make this explicit in the code.

> frameworks/av/media/codecs/m4v_h263/enc/src/mp4enc_api.cpp:1585:49:
warning: Access to field 'refSelectCode' results in a dereference of a
null pointer (loaded from field 'forwardRefVop')
[clang-analyzer-core.NullDereference]

when saving things into `tempForwRefVop` and `tempRefSelCode` above,
there's a NULL check, so it's probably best to have down here, too.

Bug: None
Test: TreeHugger
Change-Id: Iec30bfa80af4424afedb68d85f06c7134eaa2e09
parent e392f2cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ void cor_h_x2(
    Word16 j;
    Word16 k;
    Word32 s;
    Word32 y32[L_CODE];
    Word32 y32[L_CODE]{};
    Word32 max;
    Word32 tot;

+1 −1
Original line number Diff line number Diff line
@@ -1579,7 +1579,7 @@ OSCL_EXPORT_REF Bool PVEncodeVideoFrame(VideoEncControls *encCtrl, VideoEncFrame
        if (currLayer == 0)
        {
            video->forwardRefVop = tempForwRefVop; /* For P-Vop base only */
            video->forwardRefVop->refSelectCode = tempRefSelCode;
            if (video->forwardRefVop != NULL) video->forwardRefVop->refSelectCode = tempRefSelCode;
        }

        return status;