]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/wnv1.c
g723.1dec: Make postfilter user switchable
[ffmpeg] / libavcodec / wnv1.c
index 21ff361f1e7486699e619b2771165aff50890360..62e9b992a4b90c5b5d7150d65d3f407ca17d8b04 100644 (file)
@@ -70,6 +70,11 @@ static int decode_frame(AVCodecContext *avctx,
     int prev_y = 0, prev_u = 0, prev_v = 0;
     uint8_t *rbuf;
 
+    if(buf_size<=8) {
+        av_log(avctx, AV_LOG_ERROR, "buf_size %d is too small\n", buf_size);
+        return AVERROR_INVALIDDATA;
+    }
+
     rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
     if(!rbuf){
         av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");