]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/asvenc.c
avcodec/mobiclip: Check that Motion vectors are within the input frame
[ffmpeg] / libavcodec / asvenc.c
index 3cc94bf91a291276d21ca0005c1687bc8af8bde6..28f7a94071d0927f4bc93cc5aae16b4a27ca1bf9 100644 (file)
@@ -228,7 +228,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         clone->format = pict->format;
         clone->width  = FFALIGN(pict->width, 16);
         clone->height = FFALIGN(pict->height, 16);
-        ret = av_frame_get_buffer(clone, 32);
+        ret = av_frame_get_buffer(clone, 0);
         if (ret < 0) {
             av_frame_free(&clone);
             return ret;
@@ -295,6 +295,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     while (put_bits_count(&a->pb) & 31)
         put_bits(&a->pb, 8, 0);
 
+    flush_put_bits(&a->pb);
     size = put_bits_count(&a->pb) / 32;
 
     if (avctx->codec_id == AV_CODEC_ID_ASV1) {