Ticket #1217: patchzlib2.diff

File patchzlib2.diff, 1.5 KB (added by Carl Eugen Hoyos, 15 years ago)
  • libavcodec/lcldec.c

    diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
    index 65feb1a..fed1a53 100644
    a b static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac  
    415415        for (row = height - 1; row >= 0; row--) {
    416416            pixel_ptr = row * c->pic.linesize[0];
    417417            memcpy(outptr + pixel_ptr, encoded, 3 * width);
    418             encoded += 3 * width;
     418            encoded += 3 * width + (width & 3);
    419419        }
    420420        break;
    421421    case IMGTYPE_YUV411:
    … … static av_cold int decode_init(AVCodecContext *avctx)  
    512512        av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:2.\n");
    513513        break;
    514514    case IMGTYPE_RGB24:
    515         c->decomp_size = basesize * 3;
     515        c->decomp_size = basesize * 3 + (avctx->width & 3) * avctx->height;
    516516        max_decomp_size = max_basesize * 3;
    517517        avctx->pix_fmt = PIX_FMT_BGR24;
    518518        av_log(avctx, AV_LOG_DEBUG, "Image type is RGB 24.\n");
  • libavcodec/lclenc.c

    diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c
    index 16976ea..f886e73 100644
    a b static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,  
    100100
    101101    for(i = avctx->height - 1; i >= 0; i--) {
    102102        c->zstream.next_in = p->data[0]+p->linesize[0]*i;
    103         c->zstream.avail_in = avctx->width*3;
     103        c->zstream.avail_in = avctx->width*3 + (avctx->width & 3);
    104104        zret = deflate(&c->zstream, Z_NO_FLUSH);
    105105        if (zret != Z_OK) {
    106106            av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret);