summaryrefslogtreecommitdiff
path: root/libavcodec/rscc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/rscc.c')
-rw-r--r--libavcodec/rscc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c
index 9e7887da9a..a5bb7d3102 100644
--- a/libavcodec/rscc.c
+++ b/libavcodec/rscc.c
@@ -221,6 +221,11 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data,
/* Get pixels buffer, it may be deflated or just raw */
if (pixel_size == packed_size) {
+ if (bytestream2_get_bytes_left(gbc) < pixel_size) {
+ av_log(avctx, AV_LOG_ERROR, "Insufficient input for %d\n", pixel_size);
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
pixels = gbc->buffer;
} else {
uLongf len = ctx->inflated_size;