]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/tmv.c
Make calculation of mask_edge free of branches, faster of course but probably
[ffmpeg] / libavcodec / tmv.c
index 7bca0868c6855f015d00ff1d8591338b767b0cbe..29aaae1fe71b339a063209dd8e6e572ca0f4a88b 100644 (file)
@@ -52,6 +52,13 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data,
         return -1;
     }
 
+    if (avpkt->size < 2*char_rows*char_cols) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Input buffer too small, truncated sample?\n");
+        *data_size = 0;
+        return -1;
+    }
+
     tmv->pic.pict_type = FF_I_TYPE;
     tmv->pic.key_frame = 1;
     dst                = tmv->pic.data[0];
@@ -98,5 +105,6 @@ AVCodec tmv_decoder = {
     .priv_data_size = sizeof(TMVContext),
     .close          = tmv_decode_close,
     .decode         = tmv_decode_frame,
+    .capabilities   = CODEC_CAP_DR1,
     .long_name      = NULL_IF_CONFIG_SMALL("8088flex TMV"),
 };