mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04:07 +02:00
BaseTools: fix gcc12 warning
Sdk/C/LzmaEnc.c: In function ?LzmaEnc_CodeOneMemBlock?: Sdk/C/LzmaEnc.c:2828:19: error: storing the address of local variable ?outStream? in ?*p.rc.outStream? [-Werror=dangling-pointer=] 2828 | p->rc.outStream = &outStream.vt; | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ Sdk/C/LzmaEnc.c:2811:28: note: ?outStream? declared here 2811 | CLzmaEnc_SeqOutStreamBuf outStream; | ^~~~~~~~~ Sdk/C/LzmaEnc.c:2811:28: note: ?pp? declared here Sdk/C/LzmaEnc.c:2828:19: error: storing the address of local variable ?outStream? in ?*(CLzmaEnc *)pp.rc.outStream? [-Werror=dangling-pointer=] 2828 | p->rc.outStream = &outStream.vt; | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ Sdk/C/LzmaEnc.c:2811:28: note: ?outStream? declared here 2811 | CLzmaEnc_SeqOutStreamBuf outStream; | ^~~~~~~~~ Sdk/C/LzmaEnc.c:2811:28: note: ?pp? declared here cc1: all warnings being treated as errors Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
parent
7b005f344e
commit
85021f8cf2
@ -2825,12 +2825,13 @@ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit,
|
|||||||
|
|
||||||
nowPos64 = p->nowPos64;
|
nowPos64 = p->nowPos64;
|
||||||
RangeEnc_Init(&p->rc);
|
RangeEnc_Init(&p->rc);
|
||||||
p->rc.outStream = &outStream.vt;
|
|
||||||
|
|
||||||
if (desiredPackSize == 0)
|
if (desiredPackSize == 0)
|
||||||
return SZ_ERROR_OUTPUT_EOF;
|
return SZ_ERROR_OUTPUT_EOF;
|
||||||
|
|
||||||
|
p->rc.outStream = &outStream.vt;
|
||||||
res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize);
|
res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize);
|
||||||
|
p->rc.outStream = NULL;
|
||||||
|
|
||||||
*unpackSize = (UInt32)(p->nowPos64 - nowPos64);
|
*unpackSize = (UInt32)(p->nowPos64 - nowPos64);
|
||||||
*destLen -= outStream.rem;
|
*destLen -= outStream.rem;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user