summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/mqc.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/mqc.c')
-rw-r--r--core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/mqc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/mqc.c b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/mqc.c
index 18fcc47605..075594b939 100644
--- a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/mqc.c
+++ b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/mqc.c
@@ -362,7 +362,9 @@ static INLINE void opj_mqc_renormd(opj_mqc_t *const mqc) {
opj_mqc_t* opj_mqc_create(void) {
opj_mqc_t *mqc = (opj_mqc_t*)opj_malloc(sizeof(opj_mqc_t));
#ifdef MQC_PERF_OPT
- mqc->buffer = NULL;
+ if (mqc) {
+ mqc->buffer = NULL;
+ }
#endif
return mqc;
}
@@ -370,7 +372,9 @@ opj_mqc_t* opj_mqc_create(void) {
void opj_mqc_destroy(opj_mqc_t *mqc) {
if(mqc) {
#ifdef MQC_PERF_OPT
- opj_free(mqc->buffer);
+ if (mqc->buffer) {
+ opj_free(mqc->buffer);
+ }
#endif
opj_free(mqc);
}