]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/wcmv.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / wcmv.c
index 123b29ad4b8e69c13bdd1083973d55a99aa3e6ed..04c597e7674616bd70eb6fa00d68604d22f2f5bb 100644 (file)
@@ -45,7 +45,7 @@ static int decode_frame(AVCodecContext *avctx,
 {
     WCMVContext *s = avctx->priv_data;
     AVFrame *frame = data;
-    int skip, blocks, zret, ret, intra = 0, bpp = s->bpp;
+    int skip, blocks, zret, ret, intra = 0, flags = 0, bpp = s->bpp;
     GetByteContext gb;
     uint8_t *dst;
 
@@ -58,9 +58,9 @@ static int decode_frame(AVCodecContext *avctx,
     bytestream2_init(&gb, avpkt->data, avpkt->size);
     blocks = bytestream2_get_le16(&gb);
     if (!blocks)
-        return avpkt->size;
+        flags |= FF_REGET_BUFFER_FLAG_READONLY;
 
-    if ((ret = ff_reget_buffer(avctx, s->prev_frame, 0)) < 0)
+    if ((ret = ff_reget_buffer(avctx, s->prev_frame, flags)) < 0)
         return ret;
 
     if (blocks > 5) {
@@ -249,7 +249,7 @@ static av_cold int decode_close(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec ff_wcmv_decoder = {
+const AVCodec ff_wcmv_decoder = {
     .name             = "wcmv",
     .long_name        = NULL_IF_CONFIG_SMALL("WinCAM Motion Video"),
     .type             = AVMEDIA_TYPE_VIDEO,