diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp index 11db3da..f92cff4 100644 --- a/libAACenc/src/aacenc_lib.cpp +++ b/libAACenc/src/aacenc_lib.cpp @@ -1733,9 +1733,10 @@ AACENC_ERROR aacEncEncode(const HANDLE_AACENCODER hAacEncoder, } /* check if buffer descriptors are filled out properly. */ - if ((AACENC_OK != validateBufDesc(inBufDesc)) || - (AACENC_OK != validateBufDesc(outBufDesc)) || (inargs == NULL) || - (outargs == NULL)) { + if ((inargs == NULL) || (outargs == NULL) || + ((AACENC_OK != validateBufDesc(inBufDesc)) && + (inargs->numInSamples > 0)) || + (AACENC_OK != validateBufDesc(outBufDesc))) { err = AACENC_UNSUPPORTED_PARAMETER; goto bail; }