]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/xsubdec.c
dxva: move d3d11 locking/unlocking to functions
[ffmpeg] / libavcodec / xsubdec.c
index 2a766b33f7f29cf6eb2757558d7e4b13de59ae59..93fd0f4d50e542737f526419139c23f5f87b6adc 100644 (file)
@@ -91,6 +91,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     // we just ignore it
     bytestream_get_le16(&buf);
 
+    if (buf_end - buf < h + 3*4)
+        return AVERROR_INVALIDDATA;
+
     // allocate sub and set values
     sub->rects =  av_mallocz(sizeof(*sub->rects));
     if (!sub->rects)