File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2019-2024 Diligent Graphics LLC
2+ * Copyright 2019-2025 Diligent Graphics LLC
33 * Copyright 2015-2019 Egor Yusov
44 *
55 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -272,8 +272,9 @@ ENCODE_JPEG_RESULT Diligent_EncodeJpeg(Uint8* pSrcRGBPixels,
272272 /* Step 6: Finish compression */
273273 jpeg_finish_compress (& cinfo );
274274
275- IDataBlob_Resize (pDstJpegBits , mem_size );
276- void * pDstPtr = IDataBlob_GetDataPtr (pDstJpegBits , 0 );
275+ size_t dst_offset = IDataBlob_GetSize (pDstJpegBits );
276+ IDataBlob_Resize (pDstJpegBits , dst_offset + mem_size );
277+ void * pDstPtr = IDataBlob_GetDataPtr (pDstJpegBits , dst_offset );
277278 memcpy (pDstPtr , mem , mem_size );
278279
279280 /* After finish_compress, we can free memory buffer. */
You can’t perform that action at this time.
0 commit comments