switch(depth){
case 24:
for(i = 0; i < avctx->height; i++){
- memcpy(ptr, buf, n);
+ memcpy(ptr, buf, avctx->width*(depth>>3));
buf += n;
ptr += linesize;
}
return buf_size;
}
+static int bmp_decode_end(AVCodecContext *avctx)
+{
+ BMPContext* c = avctx->priv_data;
+
+ if (c->picture.data[0])
+ avctx->release_buffer(avctx, &c->picture);
+
+ return 0;
+}
+
AVCodec bmp_decoder = {
"bmp",
CODEC_TYPE_VIDEO,
sizeof(BMPContext),
bmp_decode_init,
NULL,
- NULL,
+ bmp_decode_end,
bmp_decode_frame
};