diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 6c389ba81c..a2960430e4 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -156,6 +156,8 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh /* restore top left pixel */ val = loco_get_rice(&rc); + if (val == INT_MIN) + return AVERROR_INVALIDDATA; data[0] = 128 + val; /* restore top line */ for (i = 1; i < width; i++) {