[FFmpeg-devel] [PATCH 1/2] avcodec: add MatchWare Screen Capture Codec

Rostislav Pehlivanov atomnuker at gmail.com
Mon Aug 27 21:33:11 EEST 2018


On Mon, 27 Aug 2018 at 19:20, Rostislav Pehlivanov <atomnuker at gmail.com>
wrote:

>
>
> On Sat, 25 Aug 2018 at 21:04, Paul B Mahol <onemda at gmail.com> wrote:
>
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>>  configure               |   1 +
>>  libavcodec/Makefile     |   1 +
>>  libavcodec/allcodecs.c  |   1 +
>>  libavcodec/avcodec.h    |   1 +
>>  libavcodec/codec_desc.c |   7 ++
>>  libavcodec/mwsc.c       | 192 ++++++++++++++++++++++++++++++++++++++++
>>  libavformat/riff.c      |   1 +
>>  7 files changed, 204 insertions(+)
>>  create mode 100644 libavcodec/mwsc.c
>>
>> +static int decode_frame(AVCodecContext *avctx,
>> +                        void *data, int *got_frame,
>> +                        AVPacket *avpkt)
>> +{
>> +    MWSCContext *s = avctx->priv_data;
>> +    AVFrame *frame = data;
>> +    uint8_t *buf = avpkt->data;
>> +    int buf_size = avpkt->size;
>> +    GetByteContext gb;
>> +    GetByteContext gbp;
>> +    PutByteContext pb;
>> +    int ret;
>>
>
> Can you check that avpkt->size isn't larger than the deflate buffer you've
> allocated?
>

If zlib checks that the buffer size is smaller than what it has to unpack
don't, same as the wincam decoder.


More information about the ffmpeg-devel mailing list