On Thu, Apr 23, 2015 at 1:34 PM, Martin Storsjö <[email protected]> wrote:
> On Thu, 9 Apr 2015, Vittorio Giovara wrote:
>
>> ---
>> libavcodec/lclenc.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c
>> index acf5e73..20841bc 100644
>> --- a/libavcodec/lclenc.c
>> +++ b/libavcodec/lclenc.c
>> @@ -42,6 +42,7 @@
>> #include <stdlib.h>
>>
>> #include "avcodec.h"
>> +#include "internal.h"
>> #include "lcl.h"
>> #include "libavutil/internal.h"
>> #include "libavutil/mem.h"
>> @@ -197,4 +198,6 @@ AVCodec ff_zlib_encoder = {
>>     .encode2        = encode_frame,
>>     .close          = encode_end,
>>     .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24,
>> AV_PIX_FMT_NONE },
>> +    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE |
>> +                      FF_CODEC_CAP_INIT_CLEANUP,
>> };
>> --
>> 1.9.5 (Apple Git-50.3)
>
>
> Did you verify with valgrind that calling deflateEnd is ok even when
> deflateInit hasn't been called? I don't see that explicitly mentioned in the
> zlib manual. If you did, I'd guess it's ok.

Yes, it will return an error [0] because zstream.state will be Z_NULL
(which is equivalent to 0 [1]) but we can ignore it as it returns
without consequences.
If you prefer I can explicitly mark it as such in initialization.

[0] 
https://github.com/madler/zlib/blob/50893291621658f355bc5b4d450a8d06a563053d/deflate.c#L979
[1] 
https://github.com/madler/zlib/blob/50893291621658f355bc5b4d450a8d06a563053d/zlib.h#L208
-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to